From 35aaa1ea263181d058228a6ea232197c7c88a7a1 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Mon, 27 Aug 2012 08:15:33 +0400 Subject: [PATCH] Special MEM_TYPE_SPARE to denote reserved memory. * alloc.c (enum mem_type): New memory type. (refill_memory_reserve): Use new type for spare memory. This prevents live_cons_p and live_string_p from incorrect detection of uninitialized objects from spare memory as live. --- src/ChangeLog | 8 ++++++++ src/alloc.c | 16 +++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 550d2774ad4..ec7267913d6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-08-27 Dmitry Antipov + + Special MEM_TYPE_SPARE to denote reserved memory. + * alloc.c (enum mem_type): New memory type. + (refill_memory_reserve): Use new type for spare memory. + This prevents live_cons_p and live_string_p from incorrect + detection of uninitialized objects from spare memory as live. + 2012-08-26 Paul Eggert Spelling fixes. diff --git a/src/alloc.c b/src/alloc.c index 961febb6dff..315fea25ef2 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -305,7 +305,9 @@ enum mem_type and runtime slowdown. Minor but pointless. */ MEM_TYPE_VECTORLIKE, /* Special type to denote vector blocks. */ - MEM_TYPE_VECTOR_BLOCK + MEM_TYPE_VECTOR_BLOCK, + /* Special type to denote reserved memory. */ + MEM_TYPE_SPARE }; static void *lisp_malloc (size_t, enum mem_type); @@ -3816,22 +3818,22 @@ refill_memory_reserve (void) spare_memory[0] = malloc (SPARE_MEMORY); if (spare_memory[1] == 0) spare_memory[1] = lisp_align_malloc (sizeof (struct cons_block), - MEM_TYPE_CONS); + MEM_TYPE_SPARE); if (spare_memory[2] == 0) spare_memory[2] = lisp_align_malloc (sizeof (struct cons_block), - MEM_TYPE_CONS); + MEM_TYPE_SPARE); if (spare_memory[3] == 0) spare_memory[3] = lisp_align_malloc (sizeof (struct cons_block), - MEM_TYPE_CONS); + MEM_TYPE_SPARE); if (spare_memory[4] == 0) spare_memory[4] = lisp_align_malloc (sizeof (struct cons_block), - MEM_TYPE_CONS); + MEM_TYPE_SPARE); if (spare_memory[5] == 0) spare_memory[5] = lisp_malloc (sizeof (struct string_block), - MEM_TYPE_STRING); + MEM_TYPE_SPARE); if (spare_memory[6] == 0) spare_memory[6] = lisp_malloc (sizeof (struct string_block), - MEM_TYPE_STRING); + MEM_TYPE_SPARE); if (spare_memory[0] && spare_memory[1] && spare_memory[5]) Vmemory_full = Qnil; #endif -- 2.39.2