From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Proposal: block-based vector allocator Date: Tue, 06 Dec 2011 08:35:27 -0500 Message-ID: References: <4EDDA68B.5050601@yandex.ru> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1323178552 27588 80.91.229.12 (6 Dec 2011 13:35:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 6 Dec 2011 13:35:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 06 14:35:45 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RXvBR-0005Le-5e for ged-emacs-devel@m.gmane.org; Tue, 06 Dec 2011 14:35:45 +0100 Original-Received: from localhost ([::1]:60249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXvBQ-0005I0-FV for ged-emacs-devel@m.gmane.org; Tue, 06 Dec 2011 08:35:44 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:49288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXvBJ-0005H5-Cm for emacs-devel@gnu.org; Tue, 06 Dec 2011 08:35:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RXvBD-0001LG-QE for emacs-devel@gnu.org; Tue, 06 Dec 2011 08:35:37 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:43711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXvBD-0001L2-CE for emacs-devel@gnu.org; Tue, 06 Dec 2011 08:35:31 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id pB6DZSab005501; Tue, 6 Dec 2011 08:35:28 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id DE670593FF; Tue, 6 Dec 2011 08:35:27 -0500 (EST) In-Reply-To: <4EDDA68B.5050601@yandex.ru> (Dmitry Antipov's message of "Tue, 06 Dec 2011 09:22:19 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4062=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4062> : streams <708307> : uri <1022759> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146504 Archived-At: > I've tried a few designs of block-based vector allocation, and this is > the first one which looks good enough to be proposed here. I don't have time to look at it, but I like the idea of reducing the cost of small vector allocation (currently O(log N) where N is the number of malloc'd objects). Could you give a quick overview of what you've considered and thrown away? > This vector allocator uses near-to-PAGE_SIZE blocks to allocate small vectors > and dedicated list for large vectors. For large vectors we can probably just keep using what we have now. > be satisfied from exact-fit free list, best-fit is tried, and unused > tail bytes forms a free vector which is set up on an appropriate free > list. I don't like much splitting&coalescing. Is it really needed? Stefan