emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109788: Special MEM_TYPE_SPARE to de


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109788: Special MEM_TYPE_SPARE to denote reserved memory.
Date: Mon, 27 Aug 2012 08:15:33 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109788
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Mon 2012-08-27 08:15:33 +0400
message:
  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.
modified:
  src/ChangeLog
  src/alloc.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-08-26 10:29:37 +0000
+++ b/src/ChangeLog     2012-08-27 04:15:33 +0000
@@ -1,3 +1,11 @@
+2012-08-27  Dmitry Antipov  <address@hidden>
+
+       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  <address@hidden>
 
        Spelling fixes.

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2012-08-25 04:04:08 +0000
+++ b/src/alloc.c       2012-08-27 04:15:33 +0000
@@ -305,7 +305,9 @@
      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 @@
     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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]