Be consistent with setting and testing for breathing_space
authorSteve Youngs <steve@sxemacs.org>
Wed, 25 Jan 2012 00:19:53 +0000 (10:19 +1000)
committerSteve Youngs <steve@sxemacs.org>
Wed, 25 Jan 2012 00:19:53 +0000 (10:19 +1000)
* src/alloc.c (refill_memory_reserve): Test if breathing_space is
NULL, not zero.
Don't cast the malloc.

* src/alloc.c (garbage_collect_1): Increase breathing_space to,
erm, give us more breathing space.

* src/alloc.c (reinit_alloc_once_early): Set breathing_space to
NULL, not zero.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
src/alloc.c

index f20c2a3..6f33710 100644 (file)
@@ -719,8 +719,9 @@ int dbg_eq(Lisp_Object obj1, Lisp_Object obj2)
 void refill_memory_reserve(void);
 void refill_memory_reserve(void)
 {
-       if (breathing_space == 0)
-               breathing_space = (char *)malloc(0xFFFF - MALLOC_OVERHEAD);
+       if (breathing_space == NULL) {
+               breathing_space = malloc(0xFFFF - MALLOC_OVERHEAD);
+       }
 }
 #endif /* !HAVE_MMAP || DOUG_LEA_MALLOC */
 
@@ -4903,7 +4904,7 @@ void garbage_collect_1(void)
        unbind_to(speccount, Qnil);
 
        if (!breathing_space) {
-               breathing_space = malloc(4096 - MALLOC_OVERHEAD);
+               breathing_space = malloc(0xFFFF - MALLOC_OVERHEAD);
        }
 
        UNGCPRO;
@@ -5373,7 +5374,7 @@ __init_gmp_mem_funs(void)
 void reinit_alloc_once_early(void)
 {
        gc_generation_number[0] = 0;
-       breathing_space = 0;
+       breathing_space = NULL;
        XSETINT(all_bit_vectors, 0);    /* Qzero may not be set yet. */
        XSETINT(Vgc_message, 0);
 #if !defined HAVE_BDWGC || !defined EF_USE_BDWGC