diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2013-12-15 20:36:45 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2013-12-15 20:36:45 +0400 |
commit | 32b12154933124a899dae65c1e2a993e814e60c1 (patch) | |
tree | f6c90428733d224351f7ea83fce77e57f7892bb2 /mallocx.c | |
parent | fae0f4b8139040c77d54449d976276bc53653990 (diff) | |
download | bdwgc-32b12154933124a899dae65c1e2a993e814e60c1.tar.gz |
Remove 'opp' local variable in GC_malloc_X
(code refactoring)
* alloc.c: Update comment (about free lists).
* fnlz_mlc.c (GC_finalized_malloc): Remove "opp" local variable
(replace *opp with <kind>freelist[lg]).
* gcj_mlc.c (GC_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise.
* malloc.c (GC_malloc_atomic, GC_malloc, GC_malloc_uncollectable):
Likewise.
* mallocx.c (GC_malloc_atomic_uncollectable): Likewise.
* typd_mlc.c (GC_malloc_explicitly_typed,
GC_malloc_explicitly_typed_ignore_off_page,
GC_calloc_explicitly_typed): Likewise.
Diffstat (limited to 'mallocx.c')
-rw-r--r-- | mallocx.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -508,21 +508,19 @@ GC_API int GC_CALL GC_posix_memalign(void **memptr, size_t align, size_t lb) GC_API void * GC_CALL GC_malloc_atomic_uncollectable(size_t lb) { void *op; - void **opp; size_t lg; DCL_LOCK_STATE; - if( SMALL_OBJ(lb) ) { + if (SMALL_OBJ(lb)) { GC_DBG_COLLECT_AT_MALLOC(lb); if (EXTRA_BYTES != 0 && lb != 0) lb--; /* We don't need the extra byte, since this won't be */ /* collected anyway. */ lg = GC_size_map[lb]; - opp = &(GC_auobjfreelist[lg]); LOCK(); - op = *opp; - if (EXPECT(0 != op, TRUE)) { - *opp = obj_link(op); + op = GC_auobjfreelist[lg]; + if (EXPECT(op != 0, TRUE)) { + GC_auobjfreelist[lg] = obj_link(op); obj_link(op) = 0; GC_bytes_allocd += GRANULES_TO_BYTES(lg); /* Mark bit was already set while object was on free list. */ |