diff options
author | ivmai <ivmai> | 2011-04-09 11:22:22 +0000 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2011-07-26 21:06:57 +0400 |
commit | d0d1d875e73eddbe65d30fccf7bb8cdffd6b83f2 (patch) | |
tree | 5ebd605ed98395f54be02204aacb9bf2b1a22ccb /mallocx.c | |
parent | 00ee2f7451eed8bd1cceda8001df1722067c9f17 (diff) | |
download | bdwgc-d0d1d875e73eddbe65d30fccf7bb8cdffd6b83f2.tar.gz |
2011-04-09 Ivan Maidanski <ivmai@mail.ru>
* mallocx.c (GC_malloc_uncollectable): Move to malloc.c (since
it is used internally in some places).
Diffstat (limited to 'mallocx.c')
-rw-r--r-- | mallocx.c | 51 |
1 files changed, 0 insertions, 51 deletions
@@ -438,57 +438,6 @@ GC_API void * GC_CALL GC_malloc_many(size_t lb) return result; } -/* Allocate lb bytes of pointerful, traced, but not collectable data */ -GC_API void * GC_CALL GC_malloc_uncollectable(size_t lb) -{ - void *op; - void **opp; - size_t lg; - DCL_LOCK_STATE; - - if( SMALL_OBJ(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_uobjfreelist[lg]); - LOCK(); - if( (op = *opp) != 0 ) { - *opp = obj_link(op); - obj_link(op) = 0; - GC_bytes_allocd += GRANULES_TO_BYTES(lg); - /* Mark bit ws already set on free list. It will be */ - /* cleared only temporarily during a collection, as a */ - /* result of the normal free list mark bit clearing. */ - GC_non_gc_bytes += GRANULES_TO_BYTES(lg); - UNLOCK(); - } else { - UNLOCK(); - op = (ptr_t)GC_generic_malloc((word)lb, UNCOLLECTABLE); - /* For small objects, the free lists are completely marked. */ - } - GC_ASSERT(0 == op || GC_is_marked(op)); - return((void *) op); - } else { - hdr * hhdr; - - op = (ptr_t)GC_generic_malloc((word)lb, UNCOLLECTABLE); - if (0 == op) return(0); - - GC_ASSERT(((word)op & (HBLKSIZE - 1)) == 0); /* large block */ - hhdr = HDR(op); - /* We don't need the lock here, since we have an undisguised */ - /* pointer. We do need to hold the lock while we adjust */ - /* mark bits. */ - LOCK(); - set_mark_bit_from_hdr(hhdr, 0); /* Only object. */ - GC_ASSERT(hhdr -> hb_n_marks == 0); - hhdr -> hb_n_marks = 1; - UNLOCK(); - return((void *) op); - } -} - /* Not well tested nor integrated. */ /* Debug version is tricky and currently missing. */ #include <limits.h> |