diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 16 | ||||
| -rw-r--r-- | src/conf_post.h | 10 |
2 files changed, 9 insertions, 17 deletions
diff --git a/src/alloc.c b/src/alloc.c index 1092a34801a..41b2f9e77d2 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2002,9 +2002,9 @@ allocate_string_data (struct Lisp_String *s, | |||
| 2002 | mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); | 2002 | mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); |
| 2003 | #endif | 2003 | #endif |
| 2004 | 2004 | ||
| 2005 | b->next_free = b->data; | 2005 | data = b->data; |
| 2006 | b->data[0].string = NULL; | ||
| 2007 | b->next = large_sblocks; | 2006 | b->next = large_sblocks; |
| 2007 | b->next_free = data; | ||
| 2008 | large_sblocks = b; | 2008 | large_sblocks = b; |
| 2009 | } | 2009 | } |
| 2010 | else if (current_sblock == NULL | 2010 | else if (current_sblock == NULL |
| @@ -2014,9 +2014,9 @@ allocate_string_data (struct Lisp_String *s, | |||
| 2014 | { | 2014 | { |
| 2015 | /* Not enough room in the current sblock. */ | 2015 | /* Not enough room in the current sblock. */ |
| 2016 | b = lisp_malloc (SBLOCK_SIZE, MEM_TYPE_NON_LISP); | 2016 | b = lisp_malloc (SBLOCK_SIZE, MEM_TYPE_NON_LISP); |
| 2017 | b->next_free = b->data; | 2017 | data = b->data; |
| 2018 | b->data[0].string = NULL; | ||
| 2019 | b->next = NULL; | 2018 | b->next = NULL; |
| 2019 | b->next_free = data; | ||
| 2020 | 2020 | ||
| 2021 | if (current_sblock) | 2021 | if (current_sblock) |
| 2022 | current_sblock->next = b; | 2022 | current_sblock->next = b; |
| @@ -2025,14 +2025,16 @@ allocate_string_data (struct Lisp_String *s, | |||
| 2025 | current_sblock = b; | 2025 | current_sblock = b; |
| 2026 | } | 2026 | } |
| 2027 | else | 2027 | else |
| 2028 | b = current_sblock; | 2028 | { |
| 2029 | b = current_sblock; | ||
| 2030 | data = b->next_free; | ||
| 2031 | } | ||
| 2029 | 2032 | ||
| 2030 | data = b->next_free; | 2033 | data->string = s; |
| 2031 | b->next_free = (sdata *) ((char *) data + needed + GC_STRING_EXTRA); | 2034 | b->next_free = (sdata *) ((char *) data + needed + GC_STRING_EXTRA); |
| 2032 | 2035 | ||
| 2033 | MALLOC_UNBLOCK_INPUT; | 2036 | MALLOC_UNBLOCK_INPUT; |
| 2034 | 2037 | ||
| 2035 | data->string = s; | ||
| 2036 | s->data = SDATA_DATA (data); | 2038 | s->data = SDATA_DATA (data); |
| 2037 | #ifdef GC_CHECK_STRING_BYTES | 2039 | #ifdef GC_CHECK_STRING_BYTES |
| 2038 | SDATA_NBYTES (data) = nbytes; | 2040 | SDATA_NBYTES (data) = nbytes; |
diff --git a/src/conf_post.h b/src/conf_post.h index 865d0183a57..6d54524b970 100644 --- a/src/conf_post.h +++ b/src/conf_post.h | |||
| @@ -358,16 +358,6 @@ extern int emacs_setenv_TZ (char const *); | |||
| 358 | #define INLINE_HEADER_BEGIN _GL_INLINE_HEADER_BEGIN | 358 | #define INLINE_HEADER_BEGIN _GL_INLINE_HEADER_BEGIN |
| 359 | #define INLINE_HEADER_END _GL_INLINE_HEADER_END | 359 | #define INLINE_HEADER_END _GL_INLINE_HEADER_END |
| 360 | 360 | ||
| 361 | /* To use the struct hack with N elements, declare the struct like this: | ||
| 362 | struct s { ...; t name[FLEXIBLE_ARRAY_MEMBER]; }; | ||
| 363 | and allocate (offsetof (struct s, name) + N * sizeof (t)) bytes. | ||
| 364 | IBM xlc 12.1 claims to do C99 but mishandles flexible array members. */ | ||
| 365 | #ifdef __IBMC__ | ||
| 366 | # define FLEXIBLE_ARRAY_MEMBER 1 | ||
| 367 | #else | ||
| 368 | # define FLEXIBLE_ARRAY_MEMBER | ||
| 369 | #endif | ||
| 370 | |||
| 371 | /* 'int x UNINIT;' is equivalent to 'int x;', except it cajoles GCC | 361 | /* 'int x UNINIT;' is equivalent to 'int x;', except it cajoles GCC |
| 372 | into not warning incorrectly about use of an uninitialized variable. */ | 362 | into not warning incorrectly about use of an uninitialized variable. */ |
| 373 | #if defined GCC_LINT || defined lint | 363 | #if defined GCC_LINT || defined lint |