summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2012-06-27 15:19:54 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2012-06-27 15:19:54 +0400
commit3fe6dd74d02291b80a35fcc45df2cef91a8dac9f (patch)
tree33bb8199688125ef1635c0d4d493c63b813cbd92 /src
parent1ba6038a1d5ef4ab2525690c825c807576ed98a5 (diff)
downloademacs-3fe6dd74d02291b80a35fcc45df2cef91a8dac9f.tar.gz
* alloc.c (allocate_string): Remove two redundant calls
to memset, add explicit initialization where appropriate.
Diffstat (limited to 'src')
-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 @@
+2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * alloc.c (allocate_string): Remove two redundant calls
+ to memset, add explicit initialization where appropriate.
+
2012-06-27 Glenn Morris <rgm@gnu.org>
* 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)
int i;
b = (struct string_block *) lisp_malloc (sizeof *b, MEM_TYPE_STRING);
- memset (b, 0, sizeof *b);
b->next = string_blocks;
string_blocks = b;
for (i = STRING_BLOCK_SIZE - 1; i >= 0; --i)
{
s = b->strings + i;
+ /* Every string on a free list should have NULL data pointer. */
+ s->data = NULL;
NEXT_FREE_LISP_STRING (s) = string_free_list;
string_free_list = s;
}
@@ -1958,8 +1959,10 @@ allocate_string (void)
MALLOC_UNBLOCK_INPUT;
- /* Probably not strictly necessary, but play it safe. */
- memset (s, 0, sizeof *s);
+ /* SIZE and SIZE_BYTE fields will be initialized
+ by calling allocate_string_data. */
+ s->intervals = NULL_INTERVAL;
+ s->data = NULL;
--total_free_strings;
++total_strings;