diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2012-01-18 08:36:33 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2012-01-18 12:37:04 +0400 |
commit | 33dc2ded8886f35b261c4ef3d344eca3d9fe112d (patch) | |
tree | 2f6cbcb74edf2d6b2c741fee4985e0638aa9cb6f /mallocx.c | |
parent | 63fd11df9468ac94373ba74e7bd4a97b9cc4044b (diff) | |
download | bdwgc-33dc2ded8886f35b261c4ef3d344eca3d9fe112d.tar.gz |
Use EXPECT in malloc result testing for NULL
* gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Use EXPECT to test "op"
value for NULL.
* malloc.c (GC_generic_malloc_inner, GC_malloc_uncollectable):
Likewise.
* mallocx.c (GC_generic_malloc_many, GC_posix_memalign): 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 | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -281,7 +281,8 @@ GC_API void GC_CALL GC_generic_malloc_many(size_t lb, int k, void **result) GC_ASSERT(lb != 0 && (lb & (GRANULE_BYTES-1)) == 0); if (!SMALL_OBJ(lb)) { op = GC_generic_malloc(lb, k); - if(0 != op) obj_link(op) = 0; + if (EXPECT(0 != op, TRUE)) + obj_link(op) = 0; *result = op; return; } @@ -515,7 +516,8 @@ GC_API int GC_CALL GC_posix_memalign(void **memptr, size_t align, size_t lb) lg = GC_size_map[lb]; opp = &(GC_auobjfreelist[lg]); LOCK(); - if( (op = *opp) != 0 ) { + op = *opp; + if (EXPECT(0 != op, TRUE)) { *opp = obj_link(op); obj_link(op) = 0; GC_bytes_allocd += GRANULES_TO_BYTES(lg); |