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: [patch] mem_node shrink Date: Fri, 23 Nov 2007 09:55:17 -0500 Message-ID: References: <474168CE.5020502@yandex.ru> <47458AC0.2090208@yandex.ru> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195829748 6826 80.91.229.12 (23 Nov 2007 14:55:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Nov 2007 14:55:48 +0000 (UTC) Cc: Dmitry Antipov , emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 23 15:55:54 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IvZwe-0000my-Vk for ged-emacs-devel@m.gmane.org; Fri, 23 Nov 2007 15:55:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IvZwQ-0005nH-I5 for ged-emacs-devel@m.gmane.org; Fri, 23 Nov 2007 09:55:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IvZwH-0005fN-VV for emacs-devel@gnu.org; Fri, 23 Nov 2007 09:55:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IvZwG-0005eE-C3 for emacs-devel@gnu.org; Fri, 23 Nov 2007 09:55:29 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IvZwG-0005eA-2w for emacs-devel@gnu.org; Fri, 23 Nov 2007 09:55:28 -0500 Original-Received: from tomts13.bellnexxia.net ([209.226.175.34] helo=tomts13-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IvZw7-00026v-Uz; Fri, 23 Nov 2007 09:55:20 -0500 Original-Received: from pastel.home ([74.12.207.44]) by tomts13-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20071123145518.TSNA13659.tomts13-srv.bellnexxia.net@pastel.home>; Fri, 23 Nov 2007 09:55:18 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id E285B8197; Fri, 23 Nov 2007 09:55:17 -0500 (EST) In-Reply-To: (Richard Stallman's message of "Thu, 22 Nov 2007 23:35:13 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:83964 Archived-At: >> So I think MOST_POSITIVE_FIXNUM should be replaced with something >> guaranteed to be right. Define a constant to serve as the width of >> that field, and use the same constant here in something like -((-1) << >> MEM_NODE_SIZE_WIDTH). > If GC_MALLOC_CHECK is defined, xmalloc and xrealloc calls > mem_insert. On 64-bit system, if neither USE_MMAP_FOR_BUFFERS nor > REL_ALLOC are used, xmalloc and xrealloc may grow buffer text up > to the size which fits into integer, but not into 28-bit bitfield. > So, the bitfield should be wide enough, i.e. have width > BITS_PER_EMACS_INT - 4. > There are two questions here. You're talking about whether the field > is wide enough. The other is how to write this error check: >> + if (size > MOST_POSITIVE_FIXNUM) >> + abort (); Yes. A simpler test is to read the size we just wrote in the object's field and check it reads out as the same value. Stefan