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: [RFC, PATCH] shrink struct vectorlike_header #2 Date: Wed, 07 Nov 2012 18:57:59 +0400 Message-ID: <509A76F7.3050105@yandex.ru> 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; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1352300280 7566 80.91.229.3 (7 Nov 2012 14:58:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Nov 2012 14:58:00 +0000 (UTC) Cc: Emacs development discussions To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 07 15:58:05 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 1TW74v-0000Hv-F9 for ged-emacs-devel@m.gmane.org; Wed, 07 Nov 2012 15:58:05 +0100 Original-Received: from localhost ([::1]:44934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TW74m-0005yX-IY for ged-emacs-devel@m.gmane.org; Wed, 07 Nov 2012 09:57:56 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TW74k-0005y9-4M for emacs-devel@gnu.org; Wed, 07 Nov 2012 09:57:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TW74f-0003wa-SX for emacs-devel@gnu.org; Wed, 07 Nov 2012 09:57:54 -0500 Original-Received: from forward19.mail.yandex.net ([95.108.253.144]:52030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TW74f-0003wP-Bm for emacs-devel@gnu.org; Wed, 07 Nov 2012 09:57:49 -0500 Original-Received: from smtp19.mail.yandex.net (smtp19.mail.yandex.net [95.108.252.19]) by forward19.mail.yandex.net (Yandex) with ESMTP id 8E7D01120262; Wed, 7 Nov 2012 18:57:45 +0400 (MSK) Original-Received: from smtp19.mail.yandex.net (localhost [127.0.0.1]) by smtp19.mail.yandex.net (Yandex) with ESMTP id 689C2BE017D; Wed, 7 Nov 2012 18:57:45 +0400 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp19.mail.yandex.net (nwsmtp/Yandex) with ESMTP id viZWSDJc-vjZCGnoa; Wed, 7 Nov 2012 18:57:45 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1352300265; bh=Ha8/u9Ti/GOUoGS/DBvstAP86ZcvWWzdqYLlvI5MCiM=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=oFd7jPuX/DqTQ1SLofS2Twwu+YGi84LqYzY2rhAt/uzQrNBKYwKnlAkTl3ROsP3qI H8y7fNSgK319s3MgALnNRF7UwoF8z5pKtSczbiPmmux+hb6Nmc2cXKSoB9H/23F/ji cf0G3DiMThWiHie8z4CieJc/JGl56ZKLIOqTfHdU= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 95.108.253.144 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:154713 Archived-At: On 11/06/2012 10:17 PM, Stefan Monnier wrote: >> +/* When V is on the free list, first word after header is >> + used as a pointer to next vector on the free list. */ >> + >> +#define NEXT_IN_FREE_LIST(v) \ >> + (*(struct Lisp_Vector **)((char *) v + header_size)) >> + >> /* Common shortcut to setup vector on a free list. */ > > Why change the comment rather than the code. IOW what don't you like in: > > Please make the code match the comment, e.g: > (*(struct Lisp_Vector **)&(v->contents[0])) > > I personally find it much more elegant and robust than doing pointer > arithmetic via conversion to char*. I agree that your code looks better, but it causes 'dereferencing type-punned pointer will break strict-aliasing rules' warning (and so error if --enable-gcc-warnings, gcc 4.7.2). > The rest looks fine, tho it still probably lacks the corresponding > changes in .gdbinit, right? Yes, it's still on the way... Dmitry