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 /alloc.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 'alloc.c')
-rw-r--r-- | alloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -936,7 +936,7 @@ STATIC GC_bool GC_try_to_collect_general(GC_stop_func stop_func, IF_CANCEL(int cancel_state;) DCL_LOCK_STATE; - if (!GC_is_initialized) GC_init(); + if (!EXPECT(GC_is_initialized, TRUE)) GC_init(); if (GC_debugging_started) GC_print_all_smashed(); GC_INVOKE_FINALIZERS(); LOCK(); @@ -1183,7 +1183,7 @@ GC_API int GC_CALL GC_expand_hp(size_t bytes) DCL_LOCK_STATE; LOCK(); - if (!GC_is_initialized) GC_init(); + if (!EXPECT(GC_is_initialized, TRUE)) GC_init(); result = (int)GC_expand_hp_inner(divHBLKSZ((word)bytes)); if (result) GC_requested_heapsize += bytes; UNLOCK(); |