diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2011-12-29 14:04:58 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2011-12-29 14:04:58 +0400 |
commit | 089667c19cde23eb5988778411ff28e186465d16 (patch) | |
tree | 08c25acafd9be886298ceb58d71e340ba193c59a /mallocx.c | |
parent | ad1ccb54434cb673d8a825dccf8b1cff364fd2ed (diff) | |
download | bdwgc-089667c19cde23eb5988778411ff28e186465d16.tar.gz |
Use EXPECT for checking various 'initialized' boolean variables
* alloc.c (GC_try_to_collect_general, GC_expand_hp): Use "expect true"
for GC_is_initialized value.
* gcj_mlc.c (maybe_finalize): Likewise.
* malloc.c (GC_alloc_large, GC_generic_malloc_inner, malloc): Likewise.
* mallocx.c (GC_generic_malloc_many): Likewise.
* mark_rts.c (GC_add_roots, GC_clear_roots): Likewise.
* misc.c (GC_base, GC_init): Likewise.
* ptr_chck.c (GC_same_obj, GC_is_valid_displacement, GC_is_visible):
Likewise.
* darwin_stop_world.c (GC_push_all_stacks): Use "expect true"
for GC_thr_initialized value.
* pthread_stop_world.c (GC_push_all_stacks): Likewise.
* pthread_support.c (pthread_create): Likewise.
* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Use
"expect true" for excluded_segs value.
* include/private/gc_priv.h (COND_DUMP): Use "expect false"
for GC_dump_regularly value.
* malloc.c (GC_generic_malloc): Use "expect false" for GC_have_errors
value.
* mallocx.c (GC_generic_malloc_ignore_off_page,
GC_generic_malloc_many): Likewise.
* malloc.c (calloc): Use "expect true" for lib_bounds_set value.
* os_dep.c (GC_unix_mmap_get_mem): Use "expect true" for "initialized"
value.
* pthread_stop_world.c (GC_nacl_initialize_gc_thread): Use
"expect true" for GC_nacl_thread_parking_inited value.
* pthread_support.c (INIT_REAL_SYMS): Use "expect true" for
GC_syms_initialized value; remove redundant trailing ';'.
* pthread_support.c (GC_new_thread): Use "expect true" for
first_thread_used value.
* win32_threads.c (GC_new_thread): Likewise.
* pthread_support.c (pthread_create): Use "expect true" for
parallel_initialized value.
* win32_threads.c (GC_CreateThread, GC_beginthreadex,
GC_pthread_join, GC_pthread_create, GC_pthread_sigmask,
GC_pthread_detach): Likewise.
* pthread_support.c (pthread_create): Use "expect false" for "si"
value to be NULL.
* thread_local_alloc.c (GC_init_thread_local): Use "expect true" for
keys_initialized value.
* typd_mlc.c (GC_make_descriptor): Use "expect true" for
GC_explicit_typing_initialized value.
Diffstat (limited to 'mallocx.c')
-rw-r--r-- | mallocx.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -184,7 +184,8 @@ GC_INNER void * GC_generic_malloc_ignore_off_page(size_t lb, int k) lb_rounded = GRANULES_TO_BYTES(lg); n_blocks = OBJ_SZ_TO_BLOCKS(lb_rounded); init = GC_obj_kinds[k].ok_init; - if (GC_have_errors) GC_print_all_errors(); + if (EXPECT(GC_have_errors, FALSE)) + GC_print_all_errors(); GC_INVOKE_FINALIZERS(); LOCK(); result = (ptr_t)GC_alloc_large(ADD_SLOP(lb), k, IGNORE_OFF_PAGE); @@ -286,10 +287,11 @@ GC_API void GC_CALL GC_generic_malloc_many(size_t lb, int k, void **result) } lw = BYTES_TO_WORDS(lb); lg = BYTES_TO_GRANULES(lb); - if (GC_have_errors) GC_print_all_errors(); + if (EXPECT(GC_have_errors, FALSE)) + GC_print_all_errors(); GC_INVOKE_FINALIZERS(); LOCK(); - if (!GC_is_initialized) GC_init(); + if (!EXPECT(GC_is_initialized, TRUE)) GC_init(); /* Do our share of marking work */ if (GC_incremental && !GC_dont_gc) { ENTER_GC(); |