diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/alloc.c b/src/alloc.c index 808557dd70f..0a3d469d09b 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2611,16 +2611,18 @@ verify (VECTOR_BLOCK_SIZE <= (1 << PSEUDOVECTOR_SIZE_BITS)); | |||
| 2611 | 2611 | ||
| 2612 | #define VINDEX(nbytes) (((nbytes) - VBLOCK_BYTES_MIN) / roundup_size) | 2612 | #define VINDEX(nbytes) (((nbytes) - VBLOCK_BYTES_MIN) / roundup_size) |
| 2613 | 2613 | ||
| 2614 | /* When V is on the free list, first word after header is used as a pointer | 2614 | /* This special type is used to represent any block-allocated vectorlike |
| 2615 | to next vector on the free list. It might be done in a better way with: | 2615 | object on the free list. */ |
| 2616 | 2616 | ||
| 2617 | (*(struct Lisp_Vector **)&(v->contents[0])) | 2617 | struct Lisp_Vectorlike_Free |
| 2618 | { | ||
| 2619 | struct vectorlike_header header; | ||
| 2620 | struct Lisp_Vector *next; | ||
| 2621 | }; | ||
| 2618 | 2622 | ||
| 2619 | but this breaks GCC's strict-aliasing rules (which looks more relaxed | 2623 | /* When V is on the free list, it's always treated as Lisp_Vectorlike_Free. */ |
| 2620 | for char and void pointers). */ | ||
| 2621 | 2624 | ||
| 2622 | #define NEXT_IN_FREE_LIST(v) \ | 2625 | #define NEXT_IN_FREE_LIST(v) ((struct Lisp_Vectorlike_Free *) v)->next |
| 2623 | (*(struct Lisp_Vector **)((char *) v + header_size)) | ||
| 2624 | 2626 | ||
| 2625 | /* Common shortcut to setup vector on a free list. */ | 2627 | /* Common shortcut to setup vector on a free list. */ |
| 2626 | 2628 | ||