From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: Proposal: block-based vector allocator Date: Wed, 06 Jun 2012 11:02:23 +0400 Message-ID: <4FCF007F.7080104@yandex.ru> References: <4EDDA68B.5050601@yandex.ru> <4FB4AFA4.7020601@yandex.ru> <4FBA32D9.5090704@yandex.ru> <4FC775B5.30904@yandex.ru> <4FC8709C.6000903@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1338966041 22138 80.91.229.3 (6 Jun 2012 07:00:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 6 Jun 2012 07:00:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 06 09:00:38 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ScAEP-0000bT-GT for ged-emacs-devel@m.gmane.org; Wed, 06 Jun 2012 09:00:37 +0200 Original-Received: from localhost ([::1]:39838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScAEP-0003HW-Da for ged-emacs-devel@m.gmane.org; Wed, 06 Jun 2012 03:00:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScAEI-0003H3-1V for emacs-devel@gnu.org; Wed, 06 Jun 2012 03:00:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ScAEB-0007Ek-Mf for emacs-devel@gnu.org; Wed, 06 Jun 2012 03:00:29 -0400 Original-Received: from forward18.mail.yandex.net ([95.108.253.143]:48748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScAEB-0007EK-7w for emacs-devel@gnu.org; Wed, 06 Jun 2012 03:00:23 -0400 Original-Received: from smtp17.mail.yandex.net (smtp17.mail.yandex.net [95.108.252.17]) by forward18.mail.yandex.net (Yandex) with ESMTP id EC3161782235; Wed, 6 Jun 2012 11:00:15 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1338966016; bh=2fZpKTZq8axSq2YlqjhBKk+AcKwIZ2TSrFhMcnRPmTM=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=JIsvUwBqi8yYyTeHRdcfs3d9Usc5Uej/VknP7LMWC9CGIfVGHsyBVHmstYqJ1rN0H z9T4GwhRNERzobNODTg5AHF3tSEJqy0Hv7+Nq+DiWzLYAdf/jAwT+q49syv+PaoUKz 9k1X1reZYcPDg6nX0F1rNJnDu6QzFvZUKauG3c1w= Original-Received: from smtp17.mail.yandex.net (localhost [127.0.0.1]) by smtp17.mail.yandex.net (Yandex) with ESMTP id C976B1900212; Wed, 6 Jun 2012 11:00:15 +0400 (MSK) Original-Received: from antipov.client.gelicon.ru (antipov.client.gelicon.ru [78.153.153.8]) by smtp17.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 06DmwiNY-0BDmTkGW; Wed, 6 Jun 2012 11:00:14 +0400 X-Yandex-Rcpt-Suid: monnier@iro.umontreal.ca X-Yandex-Rcpt-Suid: emacs-devel@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1338966015; bh=2fZpKTZq8axSq2YlqjhBKk+AcKwIZ2TSrFhMcnRPmTM=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=IVR39yoe+27ydy5qcLFA4Y4L+z7iI53be9ektsdyvyXigPgyUIyUJis11OJ1tgRHc ikXnJHb7/c3wsK0tII++66Irepn76ssjlnjFqhsxFFV1O6I3/r0I8GaPFL6u+rYKWm l92/5skNEKeS18AXhN04dwcnH1IEWnJ0taE3XY5s= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 95.108.253.143 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:150793 Archived-At: On 06/01/2012 09:43 PM, Stefan Monnier wrote: > BTW, if we change the vector allocation so it only uses vector-blocks > for vectors smaller than "vector-block-size / 2", as I think we should, Why? Whatever this limit's value, it's possible to construct an allocation pattern which will be a worst-case for this allocator, and I don't see why one specially designed worst-case is more probabilistic than another. [... from another e-mail...] > I'm not saying the code is wrong. I'm saying that its correctness > should be made more explicit by using a different MEM_TYPE for > vector blocks. This way the correctness argument is trivial rather than > relying on some reasoning about which kind of vector allocation > is used in which circumstance. Yet another mem_type duplicates live_vector_p, so complicates stack marking code and makes it slower; IMHO it's not worth trying to make the code larger and slower just for making correctness obvious for the reader. Dmitry