From: Dmitry Antipov <dmantipov@yandex.ru>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: [RFC, PATCH] shrink struct vectorlike_header #2
Date: Wed, 07 Nov 2012 18:57:59 +0400 [thread overview]
Message-ID: <509A76F7.3050105@yandex.ru> (raw)
In-Reply-To: <jwvpq3q61zj.fsf-monnier+emacs@gnu.org>
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
next prev parent reply other threads:[~2012-11-07 14:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-11 6:41 [PATCH] shrink struct vectorlike_header Dmitry Antipov
2012-10-11 12:57 ` Stefan Monnier
2012-11-06 17:09 ` [RFC, PATCH] shrink struct vectorlike_header #2 Dmitry Antipov
2012-11-06 18:17 ` Stefan Monnier
2012-11-07 14:57 ` Dmitry Antipov [this message]
2012-11-08 3:08 ` Stefan Monnier
2012-11-08 5:25 ` Paul Eggert
2012-11-08 13:31 ` Dmitry Antipov
2012-11-08 14:03 ` Stefan Monnier
2012-11-08 14:45 ` Dmitry Antipov
2012-11-08 15:08 ` Dmitry Antipov
2012-11-08 16:30 ` Paul Eggert
2012-11-08 17:12 ` Andreas Schwab
2012-11-08 17:42 ` Nix
2012-11-09 18:04 ` Andreas Rottmann
2012-11-08 6:56 ` Stephen J. Turnbull
2012-11-06 20:53 ` Paul Eggert
2012-11-06 21:28 ` Eli Zaretskii
2012-10-11 16:42 ` [PATCH] shrink struct vectorlike_header Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=509A76F7.3050105@yandex.ru \
--to=dmantipov@yandex.ru \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.