summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2009-03-01 01:43:01 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:44 +0200
commitf1a9c69bbce9e7097579ba3b24447ff30b40327c (patch)
treec570c907f6c71d37c349fe686502da02fd97cd93 /malloc.c
parentee6104254324ccb8728cca74b866c5b26d481cfc (diff)
2009-02-28 Hans Boehm <Hans.Boehm@hp.com> (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.
Diffstat (limited to 'malloc.c')
-rw-r--r--malloc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/malloc.c b/malloc.c
index 7d214af..62fc64c 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
}
}