Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CHERI extension #627

Open
ivmai opened this issue Mar 20, 2024 · 0 comments
Open

Support CHERI extension #627

ivmai opened this issue Mar 20, 2024 · 0 comments

Comments

@ivmai
Copy link
Owner

ivmai commented Mar 20, 2024

The purpose of this is not only support the protected mode but also better test bdwgc.

The patches in https://github.com/capablevms/bdwgc (master) should be useful.

Related issue: #461

ivmai added a commit that referenced this issue Mar 23, 2024
(refactoring)

Issue #627 (bdwgc).

* tests/huge.c (GC_WORD_MAX): Rename to SIZE_MAX; change its type from
GC_word to size_t.
* tests/huge.c (SIZE_MAX): Undefine it (before definition).
* tests/huge.c (GC_SWORD_MAX): Rename to U_SSIZE_MAX; change type from
GC_signed_word to size_t (unsigned).
* tests/huge.c (main): Rename GC_WORD_MAX to SIZE_MAX; rename
GC_SWORD_MAX to U_SSIZE_MAX.
ivmai added a commit that referenced this issue Mar 23, 2024
(refactoring)

Issue #627 (bdwgc).

Also, change sizeof(word) to sizeof(ptr_t) where PTR_ALIGN_DOWN/UP
macros are used.

* allchblk.c (find_nonbl_hblk): Change type of search_end local
variable from word to ptr_t.
* allchblk.c (find_nonbl_hblk): Use PTR_ALIGN_DOWN().
* dyn_load.c [HAVE_DL_ITERATE_PHDR && PT_GNU_RELRO && CPP_WORDSZ==64]
(GC_register_dynlib_callback): Likewise.
* dyn_load.c [ANY_MSWIN && !THREADS] (GC_cond_add_roots): Likewise.
* include/private/gc_priv.h (HBLKPTR, HBLK_PAGE_ALIGNED): Likewise.
* mark.c (GC_push_all, GC_custom_push_range, GC_push_all_eager,
GC_push_all_stack): Likewise.
* mark.c [!GC_DISABLE_INCREMENTAL] (GC_push_selected): Likewise.
* mark_rts.c (GC_add_roots_inner, GC_remove_roots_inner,
GC_exclude_static_roots): Likewise.
* misc.c [!ALWAYS_SMALL_CLEAR_STACK && !STACK_NOT_SCANNED]
(GC_clear_stack): Likewise.
* misc.c (GC_base): Likewise.
* os_dep.c [OPENBSD] (GC_skip_hole_openbsd): Likewise.
* os_dep.c [ANY_MSWIN && !CYGWIN32] (GC_get_stack_base): Likewise.
* os_dep.c [NEED_FIND_LIMIT || USE_PROC_FOR_LIBRARIES && THREADS]
(GC_find_limit_with_bound): Likewise.
* os_dep.c [HPUX_STACK_BOTTOM] (GC_get_register_stack_base): Likewise.
* os_dep.c [!ECOS && !NOSYS && !SYMBIAN && !EMSCRIPTEN && !AMIGA
&& !EMBOX && !HAIKU && !OS2 && !ANY_MSWIN && !GC_OPENBSD_THREADS
&& (!GC_SOLARIS_THREADS || _STRICT_STDC) && !STACKBOTTOM && HEURISTIC1
&& STACK_GROWS_UP] (GC_get_main_stack_base): Likewise.
* os_dep.c [MSWIN32] (GC_least_described_address): Likewise.
* dyn_load.c [HAVE_DL_ITERATE_PHDR && PT_GNU_RELRO && CPP_WORDSZ==64]
(GC_register_dynlib_callback): Change sizeof(word) to sizeof(ptr_t).
* mark.c (GC_push_all_eager, GC_push_all_stack): Likewise.
* mark_rts.c (GC_add_roots_inner, GC_remove_roots_inner,
GC_exclude_static_roots): Likewise.
* os_dep.c [!ANY_MSWIN && (SVR4 || AIX || DGUX) && !PCR]
(GC_SysVGetDataStart): Likewise.
* os_dep.c [DATASTART_USES_BSDGETDATASTART] (GC_FreeBSDGetDataStart):
Likewise.
* dyn_load.c [(SOLARISDL || LINUX) && !USE_PROC_FOR_LIBRARIES]
(GC_register_dynamic_libraries): Remove redundant parentheses.
* dyn_load.c [HAVE_DL_ITERATE_PHDR && PT_GNU_RELRO]
(GC_register_dynlib_callback): Use PTR_ALIGN_UP() instead of
PTRT_ROUNDUP_BY_MASK().
* include/private/gcconfig.h [M68K && LINUX && !__ELF__ || I386
&& (SEQUENT || HAIKU || SCO || LINUX && !__ELF__ || DJGPP) || MIPS
&& EWS4800 && _MIPS_SZPTR!=64 || M88K && CX_UX] (DATASTART): Likewise.
* include/private/gcconfig.h [MIPS && EWS4800 && _MIPS_SZPTR!=64]
(DATASTART2): Likewise.
* mark.c (GC_push_all, GC_custom_push_range, GC_push_all_eager,
GC_push_all_stack): Likewise.
* mark.c [!GC_DISABLE_INCREMENTAL] (GC_push_selected): Likewise.
* mark_rts.c (GC_add_roots_inner, GC_remove_roots_inner,
GC_exclude_static_roots): Likewise.
* os_dep.c [!ECOS && !NOSYS && !SYMBIAN && !EMSCRIPTEN && !AMIGA
&& !EMBOX && !HAIKU && !OS2 && !ANY_MSWIN && !GC_OPENBSD_THREADS
&& (!GC_SOLARIS_THREADS || _STRICT_STDC) && !STACKBOTTOM && HEURISTIC1
&& !STACK_GROWS_UP] (GC_get_main_stack_base): Likewise.
* os_dep.c [!ANY_MSWIN && (SVR4 || AIX || DGUX) && !PCR]
(GC_SysVGetDataStart): Likewise.
* os_dep.c [DATASTART_USES_BSDGETDATASTART] (GC_FreeBSDGetDataStart):
Likewise.
* os_dep.c [MMAP_SUPPORTED && !MSWIN_XBOX1] (GC_unix_mmap_get_mem):
Likewise.
* os_dep.c [!MSWIN_XBOX1 && !MSWINCE && USE_WINALLOC && MSWIN32
&& !MSWINRT_FLAVOR] (GC_win32_get_mem): Likewise.
* os_dep.c [USE_MUNMAP] (GC_unmap_start): Likewise.
* os_dep.c [MPROTECT_VDB && DONT_PROTECT_PTRFREE] (GC_protect_heap):
Likewise.
* os_dep.c [PROC_VDB] (GC_proc_read_dirty): Likewise.
* os_dep.c [MPROTECT_VDB] (GC_remove_protection): Likewise.
* dyn_load.c [ANY_MSWIN] (GC_cond_add_roots): Change type of base and
limit arguments from char* to ptr_t.
* dyn_load.c [ANY_MSWIN && !THREADS] (GC_cond_add_roots): Change type
of stack_top local variable from char* to ptr_t.
* dyn_load.c [ANY_MSWIN] (GC_register_dynamic_libraries): Change type
of p local variable from PVOID to ptr_t; change type of base, limit,
new_limit local variables from char* to ptr_t.
* dyn_load.c [ANY_MSWIN && MSWINCE] (GC_register_dynamic_libraries):
Use PTR_ALIGN_UP().
* include/private/gcconfig.h (PTR_ALIGN_DOWN): New macro.
* include/private/gcconfig.h (PTRT_ROUNDUP_BY_MASK): Define
PTR_ALIGN_UP() macro instead.
* mark.c (GC_push_all_eager, GC_push_all_stack): Change type of lim
local variable from word* to ptr_t.
* misc.c (GC_base): Declare limit and sz local variables at the
beginning of the function.
* os_dep.c [OPENBSD] (GC_skip_hole_openbsd): Change type of pgsz local
variable from word to size_t.
ivmai added a commit that referenced this issue Mar 23, 2024
(refactoring)

Issue #627 (bdwgc).

* tests/gctest.c (small_cons_uncollectable): Use GC_HIDE_POINTER().
* tests/gctest.c (UNCOLLECTABLE_CDR): Use GC_REVEAL_POINTER().
ivmai added a commit that referenced this issue Apr 15, 2024
(refactoring)

Issue #627 (bdwgc).

* include/private/gc_priv.h (COOLER_THAN): Remove.
* include/private/gc_priv.h (HOTTER_THAN): Change macro to have two
arguments; add comment.
* include/private/gc_priv.h (MAKE_HOTTER): Rename x,y arguments to p,d.
* include/private/gc_priv.h [!THREADS] (GC_is_static_root): Change type
of argument from void* to ptr_t.
* mark_rts.c [!THREADS] (GC_is_static_root): Likewise.
* ptr_chck.c [!THREADS] (GC_on_stack): Likewise.
* mark_rts.c [THREADS] (GC_push_all_stack_sections): Update condition
according to MAKE_HOTTER defintion change.
* mark_rts.c [!THREADS] (GC_push_all_stack_part_eager_sections):
Likewise.
* misc.c [!ALWAYS_SMALL_CLEAR_STACK && !STACK_NOT_SCANNED
&& !ASM_CLEAR_CODE && !THREADS] (GC_clear_stack_inner): Likewise.
* misc.c [!THREADS] (GC_init, GC_call_with_gc_active): Likewise.
* os_dep.c [!ECOS && !NOSYS && !SYMBIAN && EMSCRIPTEN && !AMIGA
&& !EMBOX && !HAIKU && !OS2 && !ANY_MSWIN && !GC_OPENBSD_THREADS
&& (!GC_SOLARIS_THREADS || _STRICT_STDC) && !CPPCHECK]
(GC_get_main_stack_base): Likewise.
* os_dep.c [GC_DARWIN_THREADS && !NO_PTHREAD_GET_STACKADDR_NP
|| GC_SOLARIS_THREADS && !_STRICT_STDC || !GET_MAIN_STACKBASE_SPECIAL]
(GC_get_stack_base): Likewise.
* os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && !(NARGS==0
&& NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE) && (I386 || SPARC)]
(GC_save_callers): Likewise.
* pthread_support.c (GC_call_with_gc_active): Likewise.
* ptr_chck.c [!THREADS] (GC_on_stack): Likewise.
* win32_threads.c [!WOW64_THREAD_CONTEXT_WORKAROUND]
(GC_push_stack_for): Likewise.
ivmai added a commit that referenced this issue Apr 15, 2024
…tr_t

(refactoring)

Issue #627 (bdwgc).

* backgraph.c (add_back_edges): Rename current local variable to q.
* mark.c (GC_mark_from): Likewise.
* typd_mlc.c (GC_typed_mark_proc): Likewise.
* backgraph.c (add_back_edges): Change type of q local variable from
word to ptr_t.
* finalize.c (GC_ignore_self_finalize_mark_proc): Likewise.
* mark.c (GC_mark_from): Likewise.
* mark.c [WRAP_MARK_SOME && PARALLEL_MARK] (GC_push_conditional_eager):
Likewise.
* typd_mlc.c (GC_typed_mark_proc): Likewise.
* include/private/gc_pmark.h (GC_mark_and_push_stack): Do not case p
argument to ptr_t.
* include/private/gc_pmark.h (GC_PUSH_ONE_STACK, GC_PUSH_ONE_HEAP):
Cast p argument to word.
* include/private/gc_pmark.h [NEED_FIXUP_POINTER] (GC_PUSH_ONE_STACK):
Change type of pp local variable from word to ptr_t.
* include/private/gc_priv.h [E2K && __ptr64__] (LOAD_TAGGED_VALUE):
Change type of val local variable from word to ptr_t.
* include/private/gc_priv.h [!E2K] (LOAD_TAGGED_VALUE): Cast p argument
to ptr_t* instead of word*.
* include/private/gcconfig.h [!FIXUP_POINTER && (DYNAMIC_POINTER_MASK
|| POINTER_MASK)] (FIXUP_POINTER): Expect p argument is of ptr_t type
(instead of word); add comment.
* mark.c [!SMALL_CONFIG && !USE_PTR_HWTAG] (GC_mark_from): Change type
of deferred local variable from word to ptr_t.
* mark.c [AMIGA || MACOS || GC_DARWIN_THREADS] (GC_push_one): Cast p
argument to ptr_t.
* mark.c [GC_WIN32_THREADS] (GC_push_many_regs): Cast regs[i] to ptr_t.
* mark.c [!SMALL_CONFIG && !USE_MARK_BYTES && !MARK_BIT_PER_OBJ]
(PUSH_GRANULE): Change type of qcontents from word to ptr_t.
* mark.c [USE_PUSH_MARKED_ACCELERATORS] (GC_push_marked1): Change type
of p, plim, q from word* to ptr_t*; cast h to ptr_t instead of word;
adjust code indentation (and reformat comment).
* mark.c [USE_PUSH_MARKED_ACCELERATORS && !UNALIGNED_PTRS]
(GC_push_marked2): Likewise.
* mark.c [USE_PUSH_MARKED_ACCELERATORS && !UNALIGNED_PTRS
&& GC_GRANULE_WORDS<4] (GC_push_marked4): Likewise.
ivmai added a commit that referenced this issue Apr 15, 2024
(refactoring)

Issue #627 (bdwgc).

Also, for gcc (and clang), do not cast pointers to words in relative
comparisons.

* allchblk.c (GC_dump_regions, find_nonbl_hblk, drop_hblk_in_chunks):
Use ADDR_LT() and ADDR_GE().
* alloc.c (GC_add_to_heap, GC_print_heap_sects,
GC_scratch_recycle_inner, GC_expand_hp_inner): Likewise.
* backgraph.c (ensure_struct, add_back_edges): Likewise.
* blacklst.c (GC_number_stack_black_listed): Likewise.
* checksums.c (GC_checksum, GC_check_dirty): Likewise.
* darwin_stop_world.c (GC_stack_range_for, GC_push_all_stacks):
Likewise.
* dbg_mlc.c (GC_get_back_ptr_info, GC_print_smashed_obj,
GC_check_heap_block): Likewise.
* dyn_load.c [USE_PROC_FOR_LIBRARIES] (sort_heap_sects): Likewise.
* dyn_load.c (GC_register_map_entries, GC_register_dynlib_callback,
GC_register_dynamic_libraries_dl_iterate_phdr): Likewise.
* dyn_load.c [ANY_MSWIN] (GC_cond_add_roots): Likewise.
* finalize.c (GC_ignore_self_finalize_mark_proc): Likewise.
* headers.c (GC_scratch_alloc, GC_install_counts, GC_remove_counts):
Likewise.
* include/private/gc_pmark.h (GC_PUSH_ONE_STACK, GC_PUSH_ONE_HEAP,
GC_mark_stack_empty): Likewise.
* include/private/gc_priv.h (HOTTER_THAN): Likewise.
* malloc.c (GC_malloc_kind_aligned_global): Likewise.
* mark.c (GC_mark_some_inner, GC_mark_from, GC_steal_mark_stack,
GC_return_mark_stack, GC_do_local_mark, GC_mark_local, GC_push_all,
GC_custom_push_range, GC_custom_push_proc, GC_push_proc,
GC_push_all_eager, GC_push_all_stack, GC_push_marked2, GC_push_marked4,
GC_push_marked, GC_push_unconditionally, GC_block_was_dirty): Likewise.
* mark_rts.c (GC_add_roots_inner, GC_add_roots_inner,
GC_remove_roots, GC_remove_roots_inner, GC_next_exclusion,
GC_exclude_static_roots_inner, GC_push_conditional_with_exclusions,
GC_push_current_stack): Likewise.
* misc.c (GC_base): Likewise.
* new_hblk.c (GC_build_fl_clear2, GC_build_fl_clear4, GC_build_fl2,
GC_build_fl4, GC_build_fl): Likewise.
* os_dep.c (GC_text_mapping, GC_init_linux_data_start, tiny_sbrk,
GC_skip_hole_openbsd, GC_find_limit_with_bound,
GC_least_described_address, GC_register_root_section,
GC_FreeBSDGetDataStart, GC_register_data_segments, GC_unmap_start,
GC_gww_read_dirty, GC_protect_heap, GC_proc_read_dirty,
soft_set_grungy_pages, GC_remove_protection, GC_print_callers):
Likewise.
* pthread_stop_world.c (GC_push_all_stacks): Likewise.
* pthread_support.c [USE_PROC_FOR_LIBRARIES]
(GC_segment_is_thread_stack): Likewise.
* pthread_support.c [(HAVE_PTHREAD_ATTR_GET_NP
|| HAVE_PTHREAD_GETATTR_NP) && IA64] (GC_greatest_stack_base_below):
Likewise.
* ptr_chck.c (GC_same_obj, GC_is_valid_displacement): Likewise.
* typd_mlc.c (GC_typed_mark_proc): Likewise.
* win32_threads.c (GC_push_stack_for): Likewise.
* alloc.c (GC_add_to_heap): Rename p argument to h; update comment;
change type of endp, hs_start, hs_end local variables from word to
ptr_t.
* alloc.c [GC_ASSERTIONS] (GC_add_to_heap): Use ADDR_INSIDE().
* dyn_load.c (GC_register_dynlib_callback): Likewise.
* malloc.c [REDIRECT_MALLOC && !REDIRECT_MALLOC_IN_HEADER] (malloc,
free): Likewise.
* mark.c (GC_mark_from): Likewise.
* mark_rts.c (GC_is_static_root, GC_remove_roots_inner): Likewise.
* os_dep.c (GC_enclosing_writable_mapping, GC_page_was_dirty,
GC_remove_protection): Likewise.
* pthread_support.c [USE_PROC_FOR_LIBRARIES && STACK_GROWS_UP]
(GC_segment_is_thread_stack): Likewise.
* ptr_chck.c (GC_same_obj): Likewise.
* win32_threads.c (GC_push_stack_for): Likewise.
* blacklst.c (GC_unpromote_black_lists, GC_add_to_black_list_stack,
GC_is_black_listed, GC_number_stack_black_listed): Remove unneeded cast
of PHT_HASH() argument.
* checksums.c (GC_checksum): Change while() loop to for() one.
* checksums.c (GC_check_dirty): Remove goto label.
* ptr_chck.c (GC_same_obj, GC_is_valid_displacement): Likewise.
* dbg_mlc.c (GC_check_heap_block): Change type of p, plim local
variables from char* to ptr_t.
* dyn_load.c [ANY_MSWIN] (GC_cond_add_roots): Change type of curr_base,
next_stack_lo, next_stack_hi local variables from char* to ptr_t.
* include/gc/gc.h (GC_ADDR_LT): New public macro.
* include/gc/gc.h [__GNUC__] (GC_ADDR_LT): Do not cast arguments to
GC_word.
* include/gc/gc.h [__CYGWIN32__ || __CYGWIN__] (GC_DATASTART,
GC_DATAEND): Use GC_ADDR_LT().
* include/gc/gc_mark.h (GC_MARK_AND_PUSH): Likewise.
* tests/gctest.c [!VERY_SMALL_CONFIG] (cons): Likewise.
* include/private/gc_priv.h (ADDR_LT, ADDR_GE, ADDR_INSIDE): New macro.
* include/private/gc_priv.h (_GC_arrays._least_real_heap_addr,
_GC_arrays._greatest_real_heap_addr): Change type from word to ptr_t.
* include/private/gc_priv.h (endGC_arrays): Use beginGC_arrays.
* include/private/gc_priv.h (GC_exclude_static_roots_inner): Use ptr_t
instead of char* type for arguments.
* include/private/gc_priv.h [GC_WIN32_THREADS] (GC_get_next_stack):
Likewise.
* win32_threads.c (GC_get_next_stack): Likewise.
* include/private/gc_priv.h [GC_WIN32_THREADS] (GC_get_next_stack):
Move comment from win32_threads.c.
* mark.c [ENABLE_TRACE] (GC_mark_from): Declare base local variable to
avoid computing GC_base() twice.
* mark_rts.c (GC_exclude_static_roots_inner): Change type of arguments
from void* to ptr_t.
* mark_rts.c (GC_push_conditional_with_exclusions): Change code to
avoid assignment inside a conditional expression.
* os_dep.c [ECOS] (ecos_gc_brk): Change type from char* to ptr_t.
* os_dep.c [MSWIN32] (GC_least_described_address): Change type of
limit, q local variables from LPVOID to ptr_t.
* os_dep.c [MSWIN32] (GC_register_root_section): Change type of p,
base, limit local variables from LPVOID and char* to ptr_t.
* os_dep.c [GWW_VDB] (GC_gww_read_dirty): Change type of h_end local
variable from struct hblk* to ptr_t.
* os_dep.c [!GC_DISABLE_INCREMENTAL] (GC_remove_protection): Likewise.
* os_dep.c [MPROTECT_VDB] (GC_protect_heap): Change type of limit local
variable from struct hblk* to ptr_t.
* os_dep.c [SOFT_VDB] (soft_set_grungy_pages): Change type of vaddr,
limit_buf, next_vaddr local variables from word to ptr_t.
* pthread_support.c (ADDR_INSIDE_OBJ): New macro.
* pthread_support.c [GC_ASSERTIONS && THREAD_LOCAL_ALLOC]
(GC_is_thread_tsd_valid): Use ADDR_INSIDE_OBJ().
* pthread_support.c [USE_PROC_FOR_LIBRARIES]
(GC_segment_is_thread_stack): Replace crtn local variable to stack_end.
* pthread_support.c [(HAVE_PTHREAD_ATTR_GET_NP
|| HAVE_PTHREAD_GETATTR_NP) && IA64] (GC_greatest_stack_base_below):
Likewise.
* win32_threads.c (GC_get_next_stack): Change type of current_min local
variable from char* to ptr_t.
ivmai added a commit that referenced this issue Apr 15, 2024
…ze_t

Issue #627 (bdwgc).

* include/gc/gc.h [GC_THREADS] (GC_register_altstack): Change type of
normstack_size and altstack_size arguments from GC_word to size_t.
* pthread_support.c [!GC_WIN32_THREADS] (GC_register_altstack):
Likewise.
* include/private/pthread_support.h [!GC_WIN32_THREADS]
(GC_StackContext_Rep): Reorder normstack and altstack_size fields.
* include/private/pthread_support.h [!GC_WIN32_THREADS]
(GC_StackContext_Rep.altstack_size, GC_StackContext_Rep.normstack):
Change type from word to size_t.
ivmai added a commit that referenced this issue Apr 15, 2024
…pages

(fix of commit e37ab2a)

Issue #627 (bdwgc).

* os_dep.c [SOFT_VDB] (soft_set_grungy_pages): Cast h to ptr_t when
passed to ADDR_LT().
ivmai added a commit that referenced this issue Apr 16, 2024
(fix of commit e37ab2a)

Issue #627 (bdwgc).

* allchblk.c (drop_hblk_in_chunks): Declare limit local variable as
a const pointer.
* mark.c [ENABLE_TRACE] (GC_mark_from): Declare base local variable as
a const pointer.
ivmai added a commit that referenced this issue Apr 16, 2024
(fix of commit e37ab2a)

Issue #627 (bdwgc).

* checksums.c (GC_check_dirty): Move h, start local variables to inner
block statement.
* ptr_chck.c (GC_same_obj): Move h local variable to inner block
statement.
ivmai added a commit that referenced this issue Apr 16, 2024
(fix of commit e37ab2a)

Issue #627 (bdwgc).

* include/gc/gc.h [__CYGWIN32__ || __CYGWIN__] (GC_DATASTART,
GC_DATAEND): Cast GC_ADDR_LT() arguments to char*.
ivmai added a commit that referenced this issue Apr 24, 2024
(refactoring)

Issue #627 (bdwgc).

* tests/gctest.c (live_indicators): Change type from GC_word[] to
void*[]; do not define if GC_NO_FINALIZATION.
* tests/gctest.c (MAX_FINALIZED_PER_THREAD, MAX_FINALIZED): Do not
define if GC_NO_FINALIZATION.
* tests/gctest.c [MACOS] (mktree): Do not set if GC_NO_FINALIZATION.
* tests/gctest.c [!GC_NO_FINALIZATION] (mktree): Remove redundant casts
to void** of &live_indicators[my_index].
ivmai added a commit that referenced this issue Apr 24, 2024
(fix of commit e37ab2a)

Issue #627 (bdwgc).

* reclaim.c (GC_clear_block, GC_start_reclaim): Use ADDR_LT().
* win32_threads.c (GC_push_stack_for): Likewise.
* reclaim.c (GC_reclaim_clear, GC_reclaim_uninit, GC_reclaim_check,
GC_do_enumerate_reachable_objects): Use ADDR_GE().
* reclaim.c [ENABLE_DISCLAIM] (GC_disclaim_and_reclaim): Likewise.
* reclaim.c [VALGRIND_TRACKING] (GC_reclaim_block): Likewise.
* tests/gctest.c [!VERY_SMALL_CONFIG] (cons): Replace ptr_t to char*
casts for GC_ADDR_LT() arguments.
ivmai added a commit that referenced this issue Apr 24, 2024
(refactoring)

Issue #627 (bdwgc).

* allchblk.c (GC_split_block): Reformat comment; rename h argument to
hbp; rename n argument to last_hbp; rename nhdr argument to last_hdr.
* allchblk.c (GC_split_block): Change (word)p-(word)q to
(word)((ptr_t)p-(ptr_t)q).
* dbg_mlc.c (GC_debug_free, GC_debug_free_inner, GC_debug_realloc):
Likewise.
* mark.c (GC_set_mark_bit, GC_clear_mark_bit, GC_is_marked): Likewise.
* mark.c (GC_push_all, GC_custom_push_range): Likewise.
* ptr_chck.c (GC_is_visible): Likewise.
* allchblk.c (GC_allochblk_nth): Rename n argument to index.
* allchblk.c (ALIGN_PAD_SZ, GC_allochblk_nth): Use ADDR() instead of
a direct cast to word.
* alloc.c (GC_set_fl_marks, GC_add_to_heap, GC_scratch_recycle_inner,
GC_expand_hp_inner): Likewise.
* backgraph.c (ensure_struct, add_edge, reset_back_edge,
backwards_height, update_max_height): Likewise.
* checksums.c [MPROTECT_VDB] (GC_record_fault): Likewise.
* checksums.c (GC_was_faulted): Likewise.
* dbg_mlc.c (CROSSES_HBLK, GC_debug_print_heap_obj_proc): Likewise.
* dyn_load.c [E2K && __ptr64__] (GC_register_map_entries): Likewise.
* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr,
GC_register_dynamic_libraries): Likewise.
* finalize.c (HASH3, GC_push_finalizer_structures,
GC_register_disappearing_link_inner,
GC_general_register_disappearing_link,
GC_unregister_disappearing_link): Likewise.
* finalize.c [!GC_TOGGLE_REFS_NOT_NEEDED] (GC_process_togglerefs,
GC_mark_togglerefs, GC_clear_togglerefs, GC_toggleref_add): Likewise.
* finalize.c [!GC_LONG_REFS_NOT_NEEDED] (GC_register_long_link,
GC_unregister_long_link): Likewise.
* finalize.c [!GC_MOVE_DISAPPEARING_LINK_NOT_NEEDED && GC_ASSERTIONS]
(GC_move_disappearing_link_inner): Likewise.
* finalize.c [!GC_MOVE_DISAPPEARING_LINK_NOT_NEEDED]
(GC_move_disappearing_link): Likewise.
* finalize.c [!GC_MOVE_DISAPPEARING_LINK_NOT_NEEDED
&& !GC_LONG_REFS_NOT_NEEDED] (GC_move_long_link): Likewise.
* fnlz_mlc.c [ENABLE_DISCLAIM] (GC_finalized_malloc): Likewise.
* headers.c (GC_header_cache_miss, GC_scratch_alloc, GC_install_header,
GC_next_block, GC_prev_block): Likewise.
* include/private/gc_hdrs.h (HCE, HCE_VALID_FOR, HDR_FROM_BI,
IS_FORWARDING_ADDR_OR_NIL): Likewise.
* include/private/gc_hdrs.h [!HASH_TL] (BI): Likewise.
* include/private/gc_hdrs.h [HASH_TL] (GET_BI): Likewise.
* include/private/gc_priv.h (MAKE_COOLER, PHT_HASH): Likewise.
* include/private/specific.h (HASH, quick_thread_id): Likewise.
* malloc.c (GC_alloc_large, GC_malloc_kind_aligned_global): Likewise.
* mark.c (GC_mark_from): Likewise.
* mark_rts.c (rt_hash, GC_remove_roots_inner,
GC_exclude_static_roots_inner): Likewise.
* misc.c [ENABLE_TRACE] (GC_init): Likewise.
* os_dep.c (GC_skip_hole_openbsd, GC_find_limit_with_bound,
GC_linux_main_stack_base, GC_SysVGetDataStart,
GC_register_data_segments, GC_unix_sbrk_get_mem, PAGE_ALIGNED,
GC_proc_read_dirty, soft_set_grungy_pages, GC_mprotect_thread,
GC_print_callers): Likewise.
* pthread_support.c (GC_record_stack_base, GC_thr_init,
GC_set_stackbottom): Likewise.
* ptr_chck.c (GC_same_obj, GC_is_visible): Likewise.
* reclaim.c [USE_MARK_BYTES] (GC_clear_block): Likewise.
* specific.c (GC_key_create_inner): Likewise.
* thread_local_alloc.c (return_single_freelist, return_freelists,
GC_init_thread_local, GC_mark_thread_local_fls_for): Likewise.
* typd_mlc.c (GC_add_ext_descriptor): Likewise.
* win32_threads.c [WOW64_THREAD_CONTEXT_WORKAROUND]
(GC_push_stack_for): Likewise.
* win32_threads.c (GC_thr_init): Likewise.
* alloc.c [SET_REAL_HEAP_BOUNDS] (GC_add_to_heap): Use ADDR() instead
of ADDR_LT() and ADDR_GE() where one argument is of word type.
* alloc.c (GC_expand_hp_inner): Likewise.
* backgraph.c (add_back_edges): Likewise.
* dbg_mlc.c [ALIGNMENT==1] (GC_get_back_ptr_info): Likewise.
* dyn_load.c [IRIX5 || USE_PROC_FOR_LIBRARIES && !LINUX]
(GC_register_dynamic_libraries): Likewise.
* headers.c (GC_scratch_alloc): Likewise.
* malloc.c (GC_malloc_kind_aligned_global): Likewise.
* mark.c (GC_mark_from, GC_steal_mark_stack): Likewise.
* dbg_mlc.c (GC_debug_realloc): Change type of base local variable from
void* to ptr_t.
* dyn_load.c [IRIX5 || USE_PROC_FOR_LIBRARIES && !LINUX]
(GC_register_dynamic_libraries): Change type of heap_start, heap_end
local variables from word to ptr_t; use ADDR() instead of ADDR_INSIDE()
where some arguments of word type.
* headers.c (get_index): Remove redundant cast of argument to word.
* include/private/gc_pmark.h [ENABLE_TRACE] (TRACE, TRACE_TARGET):
Use GC_trace_ptr instead of GC_trace_addr.
* include/private/gc_priv.h (ADDR): New macro.
* include/private/gc_priv.h (GC_scratch_end_ptr): Rename to
GC_scratch_end_addr; update comment.
* include/private/gc_priv.h (_GC_arrays._last_heap_addr,
_GC_arrays._scratch_end_addr): Change type from ptr_t to word.
* include/private/gc_priv.h [GC_ASSERTIONS || MAKE_BACK_GRAPH
|| INCLUDE_LINUX_THREAD_DESCR || KEEP_BACK_PTRS && ALIGNMENT==1]
(_GC_arrays._least_real_heap_addr,
_GC_arrays._greatest_real_heap_addr): Likewise.
* include/private/gc_priv.h [ENABLE_TRACE] (GC_trace_addr): Rename to
GC_trace_ptr.
* include/private/specific.h (CACHE_HASH): Rename to TS_CACHE_HASH.
* include/private/specific.h (HASH): Rename to TS_HASH.
* include/private/specific.h (quick_thread_id): Rename to
ts_quick_thread_id.
* mark.c (GC_mark_from): Use GC_trace_ptr instead of GC_trace_addr.
* mark_rts.c (GC_approx_sp): Change type of sp from volatile word to
volatile ptr_t.
* misc.c [ENABLE_TRACE] (GC_init): Rename addr local variable to p.
* pthread_support.c [PARALLEL_MARK] (GC_mark_thread): Define id_n local
variable (of word type); use it instead of (word)id.
* specific.c (GC_setspecific, GC_remove_specific_after_fork,
GC_slow_getspecific): Use TS_HASH() instead of HASH().
* thread_local_alloc.c (return_single_freelist): Replace while loop
to do-while one.
ivmai added a commit that referenced this issue Apr 24, 2024
(refactoring)

Issue #627 (bdwgc).

* allchblk.c [VALGRIND_TRACKING] (GC_free_profiler_hook): Replace
GC_noop1((word)p) to NOOP1_PTR(p).
* alloc.c [!GC_DISABLE_INCREMENTAL && !NO_CLOCK && CPPCHECK]
(GC_timeout_stop_func): Likewise.
* alloc.c [GWW_VDB] (GC_add_to_heap): Likewise.
* alloc.c [CPPCHECK] (GC_allocobj): Likewise.
* backgraph.c [CPPCHECK] (push_in_progress, ensure_struct, add_edge,
backwards_height, update_max_height): Likewise.
* darwin_stop_world.c [!POWERPC && !ARM32 && !AARCH64 && CPPCHECK]
(GC_FindTopOfStack): Likewise.
* dyn_load.c [LINUX && !USE_PROC_FOR_LIBRARIES && CPPCHECK
&& HOST_ANDROID && !GC_DONT_DEFINE_LINK_MAP && !(__ANDROID_API__>=21)]
(GC_register_dynamic_libraries): Likewise.
* dyn_load.c [DARWIN && LINT2] (GC_init_dyld): Likewise.
* include/private/gc_priv.h [E2K && CPPCHECK] (PS_ALLOCA_BUF):
Likewise.
* mach_dep.c [!HAVE_PUSH_REGS && !EMSCRIPTEN && UNIX_LIKE
&& !NO_GETCONTEXT && GETCONTEXT_FPU_EXCMASK_BUG && X86_64 && CPPCHECK]
(GC_with_callee_saves_pushed): Likewise.
* mark.c [CPPCHECK] (GC_signal_mark_stack_overflow,
GC_steal_mark_stack): Likewise.
* misc.c [CPPCHECK] (GC_default_warn_proc, GC_call_with_gc_active):
Likewise.
* misc.c [!THREAD && CPPCHECK] (GC_do_blocking_inner): Likewise.
* os_dep.c [NEED_PROC_MAPS && LINT2] (GC_get_maps): Likewise.
* os_dep.c [(NEED_FIND_LIMIT || UNIX_LIKE || WRAP_MARK_SOME)
&& CPPCHECK && ADDRESS_SANITIZER] (GC_set_and_save_fault_handler):
Likewise.
* os_dep.c [CPPCHECK] (GC_get_register_stack_base,
GC_linux_main_stack_base): Likewise.
* os_dep.c [!ANY_MSWIN && (SVR4 || AIX || DGUX) && !PCR
&& !AO_HAVE_fetch_and_add && CPPCHECK] (GC_SysVGetDataStart): Likewise.
* os_dep.c [USE_MUNMAP && (CPPCHECK || LINT2)] (block_unmap_inner,
GC_remap): Likewise.
* os_dep.c [MPROTECT_VDB && !DARWIN && CPPCHECK && ADDRESS_SANITIZER]
(GC_dirty_init): Likewise.
* pthread_support.c [CPPCHECK] (GC_call_with_gc_active): Likewise.
* specific.c [LINT2] (GC_remove_specific_after_fork): Likewise.
* tests/gctest.c [CPPCHECK] (reverse_test_inner, test_long_mult,
warn_proc): Likewise.
* tests/gctest.c [!NO_TYPED_TEST] (typed_test): Likewise.
* tests/gctest.c (run_one_test): Likewise.
* win32_threads.c [CPPCHECK] (copy_ptr_regs, GC_win32_start_inner):
Likewise.
* include/private/gc_priv.h (NOOP1_PTR): New macro.
ivmai added a commit that referenced this issue Jun 12, 2024
(replacement of commit 0ca8be5)

Issue #627 (bdwgc).

GC_noop1_ptr() replaces NOOP1_PTR() and GC_noop1() where used for
pointers.

* allchblk.c [VALGRIND_TRACKING] (GC_free_profiler_hook): Replace
NOOP1_PTR() usage to GC_noop1_ptr() call.
* alloc.c [!GC_DISABLE_INCREMENTAL && !NO_CLOCK && CPPCHECK]
(GC_timeout_stop_func): Likewise.
* alloc.c [GWW_VDB] (GC_add_to_heap): Likewise.
* alloc.c [CPPCHECK] (GC_allocobj): Likewise.
* backgraph.c [CPPCHECK] (push_in_progress, ensure_struct, add_edge,
backwards_height, update_max_height): Likewise.
* darwin_stop_world.c [!POWERPC && !ARM32 && !AARCH64 && CPPCHECK]
(GC_FindTopOfStack): Likewise.
* dyn_load.c [LINUX && !USE_PROC_FOR_LIBRARIES && CPPCHECK
&& HOST_ANDROID && !GC_DONT_DEFINE_LINK_MAP && !(__ANDROID_API__>=21)]
(GC_register_dynamic_libraries): Likewise.
* dyn_load.c [DARWIN && LINT2] (GC_init_dyld): Likewise.
* include/private/gc_priv.h [E2K && CPPCHECK] (PS_ALLOCA_BUF):
Likewise.
* mach_dep.c [!HAVE_PUSH_REGS && !EMSCRIPTEN && UNIX_LIKE
&& !NO_GETCONTEXT && GETCONTEXT_FPU_EXCMASK_BUG && X86_64 && CPPCHECK]
(GC_with_callee_saves_pushed): Likewise.
* mark.c [CPPCHECK] (GC_signal_mark_stack_overflow,
GC_steal_mark_stack): Likewise.
* misc.c [CPPCHECK] (GC_default_warn_proc, GC_call_with_gc_active):
Likewise.
* misc.c [!THREAD && CPPCHECK] (GC_do_blocking_inner): Likewise.
* os_dep.c [NEED_PROC_MAPS && LINT2] (GC_get_maps): Likewise.
* os_dep.c [(NEED_FIND_LIMIT || UNIX_LIKE || WRAP_MARK_SOME)
&& CPPCHECK && ADDRESS_SANITIZER] (GC_set_and_save_fault_handler):
Likewise.
* os_dep.c [CPPCHECK] (GC_get_register_stack_base,
GC_linux_main_stack_base): Likewise.
* os_dep.c [!ANY_MSWIN && (SVR4 || AIX || DGUX) && !PCR
&& !AO_HAVE_fetch_and_add && CPPCHECK] (GC_SysVGetDataStart): Likewise.
* os_dep.c [USE_MUNMAP && (CPPCHECK || LINT2)] (block_unmap_inner,
GC_remap): Likewise.
* os_dep.c [MPROTECT_VDB && !DARWIN && CPPCHECK && ADDRESS_SANITIZER]
(GC_dirty_init): Likewise.
* pthread_support.c [CPPCHECK] (GC_call_with_gc_active): Likewise.
* specific.c [LINT2] (GC_remove_specific_after_fork): Likewise.
* tests/gctest.c [CPPCHECK] (reverse_test_inner, test_long_mult,
warn_proc): Likewise.
* tests/gctest.c [!NO_TYPED_TEST] (typed_test): Likewise.
* tests/gctest.c (run_one_test): Likewise.
* win32_threads.c [CPPCHECK] (copy_ptr_regs, GC_win32_start_inner):
Likewise.
* cord/tests/cordtest.c [CPPCHECK] (test_fn, id_cord_fn): Replace
GC_noop1() call to GC_noop1_ptr() one.
* finalize.c [GC_ASSERTIONS] (GC_register_disappearing_link_inner,
GC_move_disappearing_link_inner): Likewise.
* include/gc/gc.h [(!__GNUC__ || __INTEL_COMPILER) && !LINT2]
(GC_reachable_here): Likewise.
* tests/disclaim.c [CPPCHECK] (misc_sizes_dct, pair_dct): Likewise.
* tests/staticroots_lib.c [CPPCHECK] (libsrl_getpelem): Likewise.
* tests/threadkey.c [CPPCHECK] (on_thread_exit_inner): Likewise.
* tests/weakmap.c [CPPCHECK] (set_mark_bit): Likewise.
* dyn_load.c [DARWIN && CPPCHECK] (GC_init_dyld): Call
GC_noop1_ptr(dl_handle).
* finalize.c (GC_unreachable_finalize_mark_proc): Mention GC_noop1_ptr
instead of GC_noop1 in comment.
* include/gc/gc.h [(!__GNUC__ || __INTEL_COMPILER) && LINT2]
(GC_reachable_here): Refine comment.
* include/gc/gc.h (GC_noop1): Improve comment.
* include/gc/gc.h (GC_noop1_ptr): New API function declaration.
* include/private/gc_priv.h (NOOP1_PTR): Remove macro.
* mark.c (GC_noop1_ptr): Implement.
ivmai added a commit that referenced this issue Jun 12, 2024
(refactoring)

Issue #627 (bdwgc).

* backgraph.c (add_edge): Use ADDR() for COVERT_DATAFLOW() argument.
* dyn_load.c [SOLARISDL && !USE_PROC_FOR_LIBRARIES
|| HAVE_DL_ITERATE_PHDR] (GC_FirstDLOpenedLinkMap): Likewise.
* dyn_load.c [!USE_PROC_FOR_LIBRARIES && HAVE_DL_ITERATE_PHDR]
(GC_register_main_static_data): Likewise.
* mach_dep.c (GC_with_callee_saves_pushed): Likewise.
* misc.c [!ALWAYS_SMALL_CLEAR_STACK && !STACK_NOT_SCANNED
&& !ASM_CLEAR_CODE && !CPPCHECK] (GC_clear_stack_inner): Likewise.
* misc.c (GC_call_with_stack_base): Likewise.
* misc.c [!THREADS] (GC_call_with_gc_active): Likewise.
* os_dep.c [SEARCH_FOR_DATA_START] (GC_init_linux_data_start):
Likewise.
* os_dep.c [NEED_CALLINFO && LINUX && !SMALL_CONFIG]
(GC_print_callers): Likewise.
* pthread_support.c (GC_call_with_gc_active): Likewise.
* include/private/gc_priv.h (TRUSTED_STRING): Use COVERT_DATAFLOW_P(p)
instead of COVERT_DATAFLOW(p); remove cast to char*.
* misc.c [!THREADS] (GC_call_with_gc_active): Likewise.
* pthread_support.c [GC_PTHREADS && !SN_TARGET_ORBIS
&& !SN_TARGET_PSP2] (GC_pthread_join, GC_pthread_detach): Likewise.
* include/private/gcconfig.h (COVERT_DATAFLOW): Move definition down
(to be somewhere after CPP_WORDSZ definition).
* include/private/gcconfig.h (COVERT_DATAFLOW_P): Define macro.
ivmai added a commit that referenced this issue Jun 12, 2024
Issue #627 (bdwgc).

* cord/cordprnt.c (CORD_vsprintf): Compare len (instead of res) to buf;
cast len and buf values to GC_uintptr_t instead of casting res to word
and then to char*.
* cord/cordxtra.c (CORD_nul_func, CORD_chars, refill_cache,
CORD_lf_func): Cast between pointer and char thru GC_uintptr_t instead
of word.
* include/private/dbg_mlc.h (MARKED_FOR_FINALIZATION,
MARKED_FROM_REGISTER, NOT_MARKED): Likewise.
* cord/tests/cordtest.c (test_fn, test_cord_x1, test_cord_x2):
Likewise.
* dbg_mlc.c (GC_has_other_debug_info, GC_store_debug_info_inner,
GC_check_annotated_obj): Cast body, sz to GC_uintptr_t (instead of
word); cast base/ohdr to GC_uintptr_t* instead of word*.
* dbg_mlc.c (GC_print_backtrace): Remove out label; adjust indentation.
* dbg_mlc.c (GET_OH_LINENUM): Add missing parentheses.
* include/gc/gc.h (GC_PRE_INCR3, GC_POST_INCR3): Likewise.
* dbg_mlc.c [!SHORT_DBG_HDRS] (GC_print_smashed_obj): Rename
clobbered_addr argument to clobbered; reformat comment.
* dbg_mlc.c (GC_FREED_MEM_MARKER): Move definition to dbg_mlc.h.
* dbg_mlc.c (GC_debug_free): Cast sz and GC_size(base) to GC_uintptr_t;
cast p to GC_uintptr_t* instead of word*.
* dbg_mlc.c (GC_check_leaked): Cast base to GC_uintptr_t* instead of
word*.
* include/private/dbg_mlc.h [(KEEP_BACK_PTRS || MAKE_BACK_GRAPH)
&& !(PARALLEL_MARK || KEEP_BACK_PTRS)] (GC_HAS_DEBUG_INFO): Likewise.
* dbg_mlc.c (GC_debug_invoke_finalizer): Change "fns" to "function" in
comment.
* dbg_mlc.c (store_old, GC_debug_register_finalizer,
GC_debug_register_finalizer_no_order,
GC_debug_register_finalizer_unreachable,
GC_debug_register_finalizer_ignore_self): Store NULL (instead of 0)
to *ocd.
* gc.man (.TH): Update date.
* gc.man (GC_set_warn_proc): Change arg type from GC_word to
GC_uintptr_t.
* include/gc/gc.h (GC_warn_proc, GC_ignore_warn_proc): Likewise.
* misc.c (GC_default_warn_proc, GC_ignore_warn_proc): Likewise.
* tests/cpp.cc (warn_proc): Likewise.
* gcj_mlc.c (GC_gcj_fake_mark_proc, GC_init_gcj_malloc): Rename
FUNCPTR_IS_WORD to FUNCPTR_IS_DATAPTR.
* include/private/gc_priv.h (FUNCPTR_IS_WORD): Likewise.
* misc.c [!CPPCHECK] (GC_init): Likewise.
* pthread_support.c [GC_PTHREADS && !SN_TARGET_ORBIS && !SN_TARGET_PSP2
&& DEBUG_THREADS] (GC_start_rtn_prepare_thread): Likewise.
* include/gc/gc.h (GC_uintptr_t): Define unconditionally; move
definition to the beginning of the file.
* include/gc/gc.h (GC_general_register_disappearing_link,
GC_malloc_many): Refine comment.
* include/private/gc_priv.h (GC_PUSH_ALL_SYM): Likewise.
* include/gc/gc.h (GC_hidden_pointer): Change type from GC_word to
GC_uintptr_t.
* include/private/gc_priv.h (GC_funcptr_uint): Likewise.
* include/private/dbg_mlc.h (GC_FREED_MEM_MARKER, START_FLAG,
END_FLAG): Cast to GC_uintptr_t instead of word.
* include/private/dbg_mlc.h [ALIGNMENT==1] (HIDE_BACK_PTR): Likewise.
* include/private/dbg_mlc.h (oh): Remove oh_dummy field; make
oh_back_ptr and oh_bg_ptr field either present both or not; refine
comment.
* include/private/dbg_mlc.h [!SHORT_DBG_HDRS] (oh.oh_sz, oh.oh_sf):
Change type from word to GC_uintptr_t.
* include/private/gc_priv.h (GC_ASSERT): Move definition upper (to be
right after include gc_locks.h).
* include/private/gc_priv.h (WARN): Cast arg to GC_uintptr_t instead
of word.
* include/private/gc_priv.h (WARN_PRIdPTR): Change comment to TODO
item.
* mallocx.c [_FORTIFY_SOURCE && __GNUC__ && !__clang__] (GC_realloc):
Change type of cleared_p local variable from word to GC_uintptr_t;
reformat comment.
* mallocx.c [!_FORTIFY_SOURCE || !__GNUC__ || __clang__] (GC_realloc):
Define cleared_p as a macro (and undefine it at the end of function).
* misc.c [!CPPCHECK] (GC_init): Change ptr_t to ptrdiff_t in comparison
to sizeof word.
* misc.c [!CPPCHECK && FUNCPTR_IS_DATAPTR] (GC_init): Change word to
ptr_t in comparison to sizeof GC_funcptr_uint.
* misc.c [!CPPCHECK] (GC_init): Add assertion that size of GC_uintptr_t
matches size of ptr_t.
* pthread_support.c [E2K] (GC_record_stack_base, GC_set_stackbottom):
Cast sb->reg_base to GC_uintptr_t instead of ADDR() usage.
* pthread_support.c [E2K] (GC_get_my_stackbottom): Cast crtn->ps_ofs to
GC_uintptr_t instead of word; add comment.
* tests/cpp.cc (Disguise): Change type or result from
GC_word to GC_uintptr_t.
* tests/cpp.cc (Undisguise): Rename i argument to v and change its type
from GC_word to GC_uintptr_t.
* tests/cpp.cc (main): Change type of as, bs local variables from
GC_word[] to GC_uintptr_t[].
* tests/cpp.cc (INT_TO_SEXPR, SEXPR_TO_INT): Rename argument; cast thru
GC_uintptr_t instead of GC_word.
* tests/cpp.cc [TEST_WITH_SYSTEM_MALLOC] (reverse): Cast
TEST_WITH_SYSTEM_MALLOC() result to GC_word.
* tests/cpp.cc (reverse_test_inner, finalizer, mktree): Cast between
pointer and int thru GC_uintptr_t instead GC_word.
* thread_local_alloc.c (return_freelists, GC_init_thread_local):
Likewise.
* tests/cpp.cc (warn_proc): Rename argument from p to arg; remove cast
of arg to unsigned long.
ivmai added a commit that referenced this issue Jun 12, 2024
Issue #627 (bdwgc).

* dbg_mlc.c (GC_debug_ptr_store_and_dirty): Use
GC_CAST_AWAY_CONST_PVOID() instead of explicit cast to word and then
to void*.
* include/gc/gc.h (GC_GENERAL_REGISTER_DISAPPEARING_LINK_SAFE,
GC_REGISTER_LONG_LINK_SAFE): Likewise.
* include/private/gc_priv.h (GC_base_C): Likewise.
* specific.c (GC_key_create_inner): Likewise.
* include/gc/gc.h (include/gc/gc.h): New public macro.
ivmai added a commit that referenced this issue Jun 12, 2024
(refactoring)

Issue #627 (bdwgc).

* alloc.c (GC_clear_a_few_frames): Use CAST_AWAY_VOLATILE_PVOID()
instead of a direct no-volatile cast.
* mach_dep.c (GC_with_callee_saves_pushed): Likewise.
* misc.c (GC_clear_stack, GC_clear_stack_inner): Likewise.
* os_dep.c [!ANY_MSWIN && (SVR4 || AIX || DGUX)] (GC_SysVGetDataStart):
Likewise.
* os_dep.c [!GC_DISABLE_INCREMENTAL] (GC_read_dirty): Likewise.
* specific.c (GC_setspecific): Likewise.
* win32_threads.c (GC_start_world): Likewise.
* gcj_mlc.c [FUNCPTR_IS_DATAPTR] (GC_init_gcj_malloc): Use
CAST_THRU_UINTPTR().
* include/private/gc_priv.h (NONNULL_ARG_NOT_NULL): Likewise.
* mark.c (GC_push_marked): Likewise.
* os_dep.c [GWW_VDB && MSWINRT_FLAVOR && FUNCPTR_IS_DATAPTR]
(detect_GetWriteWatch): Likewise.
* pthread_support.c [GC_PTHREADS && !SN_TARGET_ORBIS
&& !SN_TARGET_PSP2 && DEBUG_THREADS && FUNCPTR_IS_DATAPTR]
(GC_start_rtn_prepare_thread): Likewise.
* tests/gctest.c (reverse_test_inner): Likewise.
* win32_threads.c [((!HAVE_PTHREAD_SETNAME_NP_WITH_TID && !MSWINCE
&& PARALLEL_MARK) || WOW64_THREAD_CONTEXT_WORKAROUND) && MSWINRT_FLAVOR
&& FUNCPTR_IS_DATAPTR] (GC_thr_init): Likewise.
* include/private/gc_priv.h (CAST_THRU_UINTPTR,
CAST_AWAY_VOLATILE_PVOID): New macro.
* pthread_support.c [GC_USE_DLOPEN_WRAP] (TYPED_DLSYM): Likewise.
* pthread_support.c [GC_USE_DLOPEN_WRAP] (GC_init_real_syms): Use
TYPED_DLSYM().
ivmai added a commit that referenced this issue Jun 12, 2024
…calls

(fix of commit f9b4b19)

Issue #627 (bdwgc).

* include/gc/gc.h (GC_noop1_ptr): Change argument type from
volatile void* to const volatile void*.
* mark.c (GC_noop1_ptr): Likewise.
ivmai added a commit that referenced this issue Jun 12, 2024
(fix of commit f68db21)

Issue #627 (bdwgc).

* dbg_mlc.c [KEEP_BACK_PTRS] (GC_print_backtrace): Move source, offset,
base local variables to the inner scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant