aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog5
-rw-r--r--src/alloc.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2c8d7eb6efb..0c3568efb4f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * alloc.c (allocate_string): Remove two redundant calls
4 to memset, add explicit initialization where appropriate.
5
12012-06-27 Glenn Morris <rgm@gnu.org> 62012-06-27 Glenn Morris <rgm@gnu.org>
2 7
3 * lisp.mk (lisp): Remove paths.elc. 8 * lisp.mk (lisp): Remove paths.elc.
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;