From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: [RFC, PATCH] shrink struct vectorlike_header #2 Date: Tue, 06 Nov 2012 12:53:19 -0800 Message-ID: <509978BF.6090905@cs.ucla.edu> References: <50766A2C.8070705@yandex.ru> <50994448.6020602@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1352235205 15406 80.91.229.3 (6 Nov 2012 20:53:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Nov 2012 20:53:25 +0000 (UTC) Cc: Stefan Monnier , Emacs development discussions To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 06 21:53:35 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 1TVq9N-0004pd-SJ for ged-emacs-devel@m.gmane.org; Tue, 06 Nov 2012 21:53:33 +0100 Original-Received: from localhost ([::1]:57047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVq9E-0006Br-Vm for ged-emacs-devel@m.gmane.org; Tue, 06 Nov 2012 15:53:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVq9C-0006Ba-0b for emacs-devel@gnu.org; Tue, 06 Nov 2012 15:53:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVq9B-0001mT-4R for emacs-devel@gnu.org; Tue, 06 Nov 2012 15:53:21 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:45235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVq9A-0001mP-Ux for emacs-devel@gnu.org; Tue, 06 Nov 2012 15:53:21 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 79237A60006; Tue, 6 Nov 2012 12:53:20 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kNPjnmhtAC4L; Tue, 6 Nov 2012 12:53:20 -0800 (PST) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 23EE6A60004; Tue, 6 Nov 2012 12:53:20 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 In-Reply-To: <50994448.6020602@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 131.179.128.62 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:154707 Archived-At: > +struct large_vector > +{ > + union { > + struct large_vector *vector; > +#if USE_LSB_TAG > + /* We need to maintain ROUNDUP_SIZE alignment for the vector member. */ > + unsigned char c[vroundup (sizeof (void *))]; > +#endif That 'void *' should be 'struct large_vector *', mostly for readability (but also for weird architectures where different pointer types have different sizes). > +/* Size of the struct buffer part beyond leading > + Lisp_Objects, in word_size units. */ > + > +#define BUFFER_REST_SIZE \ > + ((sizeof (struct buffer) - header_size) / word_size - BUFFER_LISP_SIZE) This assumes (sizeof (struct buffer) - header_size) is a multiple of word_size, but that's not necessarily the case. Does it matter that BUFFER_REST_SIZE might be incorrect? If so, it needs to be fixed; if not, there should be a comment explaining why it doesn't matter whether the value is correct. Otherwise, looks good; thanks.