]> git.eshelyaron.com Git - emacs.git/commitdiff
Special MEM_TYPE_SPARE to denote reserved memory.
authorDmitry Antipov <dmantipov@yandex.ru>
Mon, 27 Aug 2012 04:15:33 +0000 (08:15 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Mon, 27 Aug 2012 04:15:33 +0000 (08:15 +0400)
* 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
src/alloc.c

index 550d2774ad4b6e92e36625391c29b507c7487813..ec7267913d6c9b32f58584b09f54ec9284fc236c 100644 (file)
@@ -1,3 +1,11 @@
+2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       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  <eggert@cs.ucla.edu>
 
        Spelling fixes.
index 961febb6dfffca96f4a79418534d21d14e0afe23..315fea25ef25621eb8d250960a711f5e1eec4ba6 100644 (file)
@@ -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