summaryrefslogtreecommitdiff
path: root/os_dep.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-11-07 23:34:04 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-11-07 23:34:04 +0300
commit93374170974aba0e9992c5acedb52d887f237a93 (patch)
tree35d345fc070dd3d5cbbc68b2dd60e886c7aad900 /os_dep.c
parent36a6d79e182861a70c53a604e36bb34a8bad7bd1 (diff)
downloadbdwgc-93374170974aba0e9992c5acedb52d887f237a93.tar.gz
Use GC_WORD_MAX macro across all C source files
(code refactoring) * alloc.c (GC_collect_at_heapsize, GC_compute_heap_usage_percent, GC_add_to_heap, GC_expand_hp_inner): Use GC_WORD_MAX instead of (word)-1. * dyn_load.c [DATASTART_IS_FUNC] (GC_register_dynamic_libraries_dl_iterate_phdr): Likewise. * finalize.c [KEEP_BACK_PTRS] (GC_notify_or_invoke_finalizers): Likewise. * headers.c (GC_install_counts): Likewise. * include/private/thread_local_alloc.h [GC_GCJ_SUPPORT] (ERROR_FL): Likewise. * os_dep.c [NEED_FIND_LIMIT || USE_PROC_FOR_LIBRARIES] (GC_find_limit): Likewise. * os_dep.c [MPROTECT_VDB && DARWIN] (GC_mprotect_thread): Likewise. * pthread_support.c [PARALLEL_MARK] (GC_mark_thread): Likewise. * win32_threads.c (ADDR_LIMIT): Likewise. * win32_threads.c [PARALLEL_MARK] (GC_mark_thread): Likewise. * alloc.c (GC_least_plausible_heap_addr): Use GC_WORD_MAX instead of ONES macro. * include/private/gc_priv.h [STACK_GROWS_DOWN] (MAKE_COOLER): Likewise. * mark.c (GC_set_hdr_marks): Likewise. * alloc.c (GC_WORD_MAX): Remove definition (in this file). * headers.c (GC_install_counts): Reformat code. * include/private/gc_priv.h (ONES): Rename to GC_WORD_MAX.
Diffstat (limited to 'os_dep.c')
-rw-r--r--os_dep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/os_dep.c b/os_dep.c
index 6eee61aa..5900f9c8 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -1029,7 +1029,7 @@ GC_INNER size_t GC_page_size = 0;
ptr_t GC_find_limit(ptr_t p, GC_bool up)
{
- return GC_find_limit_with_bound(p, up, up ? (ptr_t)(word)(-1) : 0);
+ return GC_find_limit_with_bound(p, up, up ? (ptr_t)GC_WORD_MAX : 0);
}
# endif /* NEED_FIND_LIMIT || USE_PROC_FOR_LIBRARIES */
@@ -4042,7 +4042,7 @@ STATIC void *GC_mprotect_thread(void *arg)
} msg;
mach_msg_id_t id;
- if ((word)arg == (word)-1) return 0; /* to make compiler happy */
+ if ((word)arg == GC_WORD_MAX) return 0; /* to prevent a compiler warning */
# if defined(CPPCHECK)
reply.data[0] = 0; /* to prevent "field unused" warnings */
msg.data[0] = 0;