aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-08-27 08:15:33 +0400
committerDmitry Antipov2012-08-27 08:15:33 +0400
commit35aaa1ea263181d058228a6ea232197c7c88a7a1 (patch)
tree0e86c75a582d818add69aeea210b0a0c36b04fc6 /src/alloc.c
parent77f1f99cb0d69c1cddb0f1c5ef264fe5cd62d210 (diff)
downloademacs-35aaa1ea263181d058228a6ea232197c7c88a7a1.tar.gz
emacs-35aaa1ea263181d058228a6ea232197c7c88a7a1.zip
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.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c16
1 files changed, 9 insertions, 7 deletions
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
305 and runtime slowdown. Minor but pointless. */ 305 and runtime slowdown. Minor but pointless. */
306 MEM_TYPE_VECTORLIKE, 306 MEM_TYPE_VECTORLIKE,
307 /* Special type to denote vector blocks. */ 307 /* Special type to denote vector blocks. */
308 MEM_TYPE_VECTOR_BLOCK 308 MEM_TYPE_VECTOR_BLOCK,
309 /* Special type to denote reserved memory. */
310 MEM_TYPE_SPARE
309}; 311};
310 312
311static void *lisp_malloc (size_t, enum mem_type); 313static void *lisp_malloc (size_t, enum mem_type);
@@ -3816,22 +3818,22 @@ refill_memory_reserve (void)
3816 spare_memory[0] = malloc (SPARE_MEMORY); 3818 spare_memory[0] = malloc (SPARE_MEMORY);
3817 if (spare_memory[1] == 0) 3819 if (spare_memory[1] == 0)
3818 spare_memory[1] = lisp_align_malloc (sizeof (struct cons_block), 3820 spare_memory[1] = lisp_align_malloc (sizeof (struct cons_block),
3819 MEM_TYPE_CONS); 3821 MEM_TYPE_SPARE);
3820 if (spare_memory[2] == 0) 3822 if (spare_memory[2] == 0)
3821 spare_memory[2] = lisp_align_malloc (sizeof (struct cons_block), 3823 spare_memory[2] = lisp_align_malloc (sizeof (struct cons_block),
3822 MEM_TYPE_CONS); 3824 MEM_TYPE_SPARE);
3823 if (spare_memory[3] == 0) 3825 if (spare_memory[3] == 0)
3824 spare_memory[3] = lisp_align_malloc (sizeof (struct cons_block), 3826 spare_memory[3] = lisp_align_malloc (sizeof (struct cons_block),
3825 MEM_TYPE_CONS); 3827 MEM_TYPE_SPARE);
3826 if (spare_memory[4] == 0) 3828 if (spare_memory[4] == 0)
3827 spare_memory[4] = lisp_align_malloc (sizeof (struct cons_block), 3829 spare_memory[4] = lisp_align_malloc (sizeof (struct cons_block),
3828 MEM_TYPE_CONS); 3830 MEM_TYPE_SPARE);
3829 if (spare_memory[5] == 0) 3831 if (spare_memory[5] == 0)
3830 spare_memory[5] = lisp_malloc (sizeof (struct string_block), 3832 spare_memory[5] = lisp_malloc (sizeof (struct string_block),
3831 MEM_TYPE_STRING); 3833 MEM_TYPE_SPARE);
3832 if (spare_memory[6] == 0) 3834 if (spare_memory[6] == 0)
3833 spare_memory[6] = lisp_malloc (sizeof (struct string_block), 3835 spare_memory[6] = lisp_malloc (sizeof (struct string_block),
3834 MEM_TYPE_STRING); 3836 MEM_TYPE_SPARE);
3835 if (spare_memory[0] && spare_memory[1] && spare_memory[5]) 3837 if (spare_memory[0] && spare_memory[1] && spare_memory[5])
3836 Vmemory_full = Qnil; 3838 Vmemory_full = Qnil;
3837#endif 3839#endif