diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/alloc.c b/src/alloc.c index e1fd479699a..d7ebd556f00 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1936,13 +1936,14 @@ allocate_string (void) | |||
| 1936 | int i; | 1936 | int i; |
| 1937 | 1937 | ||
| 1938 | b = (struct string_block *) lisp_malloc (sizeof *b, MEM_TYPE_STRING); | 1938 | b = (struct string_block *) lisp_malloc (sizeof *b, MEM_TYPE_STRING); |
| 1939 | memset (b, 0, sizeof *b); | ||
| 1940 | b->next = string_blocks; | 1939 | b->next = string_blocks; |
| 1941 | string_blocks = b; | 1940 | string_blocks = b; |
| 1942 | 1941 | ||
| 1943 | for (i = STRING_BLOCK_SIZE - 1; i >= 0; --i) | 1942 | for (i = STRING_BLOCK_SIZE - 1; i >= 0; --i) |
| 1944 | { | 1943 | { |
| 1945 | s = b->strings + i; | 1944 | s = b->strings + i; |
| 1945 | /* Every string on a free list should have NULL data pointer. */ | ||
| 1946 | s->data = NULL; | ||
| 1946 | NEXT_FREE_LISP_STRING (s) = string_free_list; | 1947 | NEXT_FREE_LISP_STRING (s) = string_free_list; |
| 1947 | string_free_list = s; | 1948 | string_free_list = s; |
| 1948 | } | 1949 | } |
| @@ -1958,8 +1959,10 @@ allocate_string (void) | |||
| 1958 | 1959 | ||
| 1959 | MALLOC_UNBLOCK_INPUT; | 1960 | MALLOC_UNBLOCK_INPUT; |
| 1960 | 1961 | ||
| 1961 | /* Probably not strictly necessary, but play it safe. */ | 1962 | /* SIZE and SIZE_BYTE fields will be initialized |
| 1962 | memset (s, 0, sizeof *s); | 1963 | by calling allocate_string_data. */ |
| 1964 | s->intervals = NULL_INTERVAL; | ||
| 1965 | s->data = NULL; | ||
| 1963 | 1966 | ||
| 1964 | --total_free_strings; | 1967 | --total_free_strings; |
| 1965 | ++total_strings; | 1968 | ++total_strings; |