mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-15 17:00:26 +00:00
* alloc.c (allocate_string): Remove two redundant calls
to memset, add explicit initialization where appropriate.
This commit is contained in:
parent
1ba6038a1d
commit
3fe6dd74d0
@ -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.
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user