summaryrefslogtreecommitdiff
path: root/ptr_chck.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-12-29 14:04:58 +0400
committerIvan Maidanski <ivmai@mail.ru>2011-12-29 14:04:58 +0400
commit089667c19cde23eb5988778411ff28e186465d16 (patch)
tree08c25acafd9be886298ceb58d71e340ba193c59a /ptr_chck.c
parentad1ccb54434cb673d8a825dccf8b1cff364fd2ed (diff)
downloadbdwgc-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 'ptr_chck.c')
-rw-r--r--ptr_chck.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ptr_chck.c b/ptr_chck.c
index 5b3cc0a6..a4766339 100644
--- a/ptr_chck.c
+++ b/ptr_chck.c
@@ -43,7 +43,7 @@ GC_API void * GC_CALL GC_same_obj(void *p, void *q)
ptr_t base, limit;
word sz;
- if (!GC_is_initialized) GC_init();
+ if (!EXPECT(GC_is_initialized, TRUE)) GC_init();
hhdr = HDR((word)p);
if (hhdr == 0) {
if (divHBLKSZ((word)p) != divHBLKSZ((word)q)
@@ -122,7 +122,7 @@ GC_API void * GC_CALL GC_is_valid_displacement(void *p)
struct hblk *h;
word sz;
- if (!GC_is_initialized) GC_init();
+ if (!EXPECT(GC_is_initialized, TRUE)) GC_init();
hhdr = HDR((word)p);
if (hhdr == 0) return(p);
h = HBLKPTR(p);
@@ -189,7 +189,7 @@ GC_API void * GC_CALL GC_is_visible(void *p)
hdr *hhdr;
if ((word)p & (ALIGNMENT - 1)) goto fail;
- if (!GC_is_initialized) GC_init();
+ if (!EXPECT(GC_is_initialized, TRUE)) GC_init();
# ifdef THREADS
hhdr = HDR((word)p);
if (hhdr != 0 && GC_base(p) == 0) {