|
From: | Dmitry Antipov |
Subject: | Re: [RFC, PATCH] shrink struct vectorlike_header #2 |
Date: | Wed, 07 Nov 2012 18:57:59 +0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |