From: hboehm Date: Sun, 1 Mar 2009 00:43:01 +0000 (+0000) Subject: 2009-02-28 Hans Boehm (Really Ivan Maidansky) X-Git-Tag: gc7_2alpha2~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f1a9c69bbce9e7097579ba3b24447ff30b40327c;p=gc 2009-02-28 Hans Boehm (Really Ivan Maidansky) * alloc.c (GC_try_to_collect): Remove duplicate initialization check. * malloc.c (GC_generic_malloc): Remove lw to eliminate single- threaded warnings. * mallocx.c (GC_generic_malloc_ignore_off_page): Ditto. --- diff --git a/ChangeLog b/ChangeLog index 5fb8b053..2f75153f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-28 Hans Boehm (Really Ivan Maidansky) + * alloc.c (GC_try_to_collect): Remove duplicate initialization + check. + * malloc.c (GC_generic_malloc): Remove lw to eliminate single- + threaded warnings. + * mallocx.c (GC_generic_malloc_ignore_off_page): Ditto. + 2009-02-28 Hans Boehm (Mostly Ivan Maidansky) * allchblk.c, backgraph.c, dbg_mlc.c, dyn_load.c, finalize.c, include/private/gc_pmark.h, malloc.c, mark.c, diff --git a/alloc.c b/alloc.c index f40282a6..01596219 100644 --- a/alloc.c +++ b/alloc.c @@ -822,7 +822,6 @@ GC_API int GC_CALL GC_try_to_collect(GC_stop_func stop_func) GC_INVOKE_FINALIZERS(); LOCK(); ENTER_GC(); - if (!GC_is_initialized) GC_init_inner(); /* Minimize junk left in my registers */ GC_noop(0,0,0,0,0,0); result = (int)GC_try_to_collect_inner(stop_func); diff --git a/malloc.c b/malloc.c index 7d214af3..62fc64cf 100644 --- a/malloc.c +++ b/malloc.c @@ -159,12 +159,11 @@ void * GC_generic_malloc(size_t lb, int k) result = GC_generic_malloc_inner((word)lb, k); UNLOCK(); } else { - size_t lg, lw; + size_t lg; size_t lb_rounded; word n_blocks; GC_bool init; lg = ROUNDED_UP_GRANULES(lb); - lw = GRANULES_TO_WORDS(lg); lb_rounded = GRANULES_TO_BYTES(lg); n_blocks = OBJ_SZ_TO_BLOCKS(lb_rounded); init = GC_obj_kinds[k].ok_init; @@ -179,8 +178,8 @@ void * GC_generic_malloc(size_t lb, int k) /* before we release the lock. */ ((word *)result)[0] = 0; ((word *)result)[1] = 0; - ((word *)result)[lw-1] = 0; - ((word *)result)[lw-2] = 0; + ((word *)result)[GRANULES_TO_WORDS(lg)-1] = 0; + ((word *)result)[GRANULES_TO_WORDS(lg)-2] = 0; # endif } } diff --git a/mallocx.c b/mallocx.c index b010bccb..60637a10 100644 --- a/mallocx.c +++ b/mallocx.c @@ -167,7 +167,7 @@ void * realloc(void * p, size_t lb) void * GC_generic_malloc_ignore_off_page(size_t lb, int k) { void *result; - size_t lg, lw; + size_t lg; size_t lb_rounded; word n_blocks; GC_bool init; @@ -176,7 +176,6 @@ void * GC_generic_malloc_ignore_off_page(size_t lb, int k) if (SMALL_OBJ(lb)) return(GC_generic_malloc((word)lb, k)); lg = ROUNDED_UP_GRANULES(lb); - lw = GRANULES_TO_WORDS(lg); lb_rounded = GRANULES_TO_BYTES(lg); n_blocks = OBJ_SZ_TO_BLOCKS(lb_rounded); init = GC_obj_kinds[k].ok_init; @@ -193,8 +192,8 @@ void * GC_generic_malloc_ignore_off_page(size_t lb, int k) /* before we release the lock. */ ((word *)result)[0] = 0; ((word *)result)[1] = 0; - ((word *)result)[lw-1] = 0; - ((word *)result)[lw-2] = 0; + ((word *)result)[GRANULES_TO_WORDS(lg)-1] = 0; + ((word *)result)[GRANULES_TO_WORDS(lg)-2] = 0; # endif } }