summaryrefslogtreecommitdiff
path: root/ptr_chck.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused DCL_LOCK_STATEIvan Maidanski2023-01-301-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (refactoring) * alloc.c (GC_set_disable_automatic_collection, GC_set_stop_func, GC_get_disable_automatic_collection, GC_get_stop_func, GC_set_start_callback, GC_get_start_callback, GC_set_on_collection_event, GC_get_on_collection_event, GC_collect_a_little, GC_try_to_collect_general, GC_expand_hp): Remove DCL_LOCK_STATE. * alloc.c [!GC_DISABLE_INCREMENTAL] (GC_start_incremental_collection): Likewise. * dbg_mlc.c (GC_generate_random_backtrace, store_debug_info, GC_debug_register_displacement): Likewise. * dyn_load.c [DARWIN_DEBUG && !NO_DEBUGGING] (GC_dyld_image_add, GC_dyld_image_remove): Likewise. * finalize.c (GC_register_disappearing_link_inner, GC_unregister_disappearing_link, GC_complete_ongoing_collection, GC_set_toggleref_func, GC_get_toggleref_func, GC_toggleref_add, GC_set_await_finalize_proc, GC_get_await_finalize_proc, GC_unregister_long_link, GC_move_disappearing_link, GC_move_long_link, GC_register_finalizer_inner, GC_finalize, GC_invoke_finalizers, GC_notify_or_invoke_finalizers): Likewise. * fnlz_mlc.c (GC_init_finalized_malloc): Likewise. * gc_dlopen.c [!USE_PROC_FOR_LIBRARIES] (disable_gc_for_dlopen): Likewise. * gcj_mlc.c (GC_init_gcj_malloc, maybe_finalize, GC_core_gcj_malloc, GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise. * malloc.c (GC_alloc_large, GC_generic_malloc_inner, GC_generic_malloc_aligned, GC_malloc_kind_global, GC_generic_malloc_uncollectable, GC_free): Likewise. * mallocx.c (GC_realloc, GC_generic_malloc_ignore_off_page, GC_generic_malloc_many): Likewise. * mark.c (GC_print_trace): Likewise. * mark_rts.c (GC_add_roots, GC_clear_roots, GC_remove_roots): Likewise. * misc.c (GC_get_heap_usage_safe, GC_get_heap_usage_safe, GC_is_init_called, GC_init, GC_enable_incremental, GC_start_mark_threads, GC_set_warn_proc, GC_get_warn_proc, GC_set_abort_func, GC_get_abort_func, GC_enable, GC_disable, GC_new_free_list, GC_new_kind, GC_new_proc, GC_call_with_alloc_lock, GC_dump, GC_get_memory_use, GC_alloc_lock, GC_set_on_thread_event, GC_get_on_thread_event, GC_set_oom_fn, GC_get_oom_fn, GC_set_on_heap_resize, GC_get_on_heap_resize, GC_set_finalizer_notifier, GC_get_finalizer_notifier, GC_set_all_interior_pointers): Likewise. * obj_map.c (GC_register_displacement): Likewise. * os_dep.c (GC_get_stack_base, GC_print_callers): Likewise. * pthread_stop_world.c [GC_ENABLE_SUSPEND_THREAD] (GC_suspend_thread, GC_resume_thread, GC_is_thread_suspended): Likewise. * pthread_support.c (GC_is_thread_tsd_valid, GC_thread_is_registered, GC_register_altstack, GC_wait_for_gc_completion, GC_init_parallel, GC_do_blocking_inner, GC_suspend_self_blocked, GC_get_my_stackbottom, GC_call_with_gc_active, GC_unregister_my_thread, GC_pthread_cancel, GC_pthread_exit, GC_allow_register_threads, GC_register_my_thread, GC_thread_exit_proc, GC_pthread_join, GC_pthread_detach, GC_start_rtn_prepare_thread): Likewise. * ptr_chck.c (GC_set_same_obj_print_proc, GC_get_same_obj_print_proc, GC_set_is_valid_displacement_print_proc, GC_set_is_visible_print_proc, GC_get_is_valid_displacement_print_proc, GC_get_is_visible_print_proc): Likewise. * reclaim.c (GC_print_all_errors): Likewise. * typd_mlc.c (GC_add_ext_descriptor, GC_make_descriptor, GC_malloc_explicitly_typed_ignore_off_page, GC_calloc_explicitly_typed): Likewise. * alloc.c (GC_max_retries): Change type from GC_word to word. * include/private/gc_locks.h: Remove DCL_LOCK_STATE from comment, * include/private/gc_locks.h (DCL_LOCK_STATE): Do not define.
* Export setter and getter for pointer checking print proceduresIvan Maidanski2023-01-301-5/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Direct access to GC_same_obj_print_proc, GC_is_visible_print_proc and GC_is_valid_displacement_print_proc is now deprecated. * include/gc/gc.h (GC_same_obj_print_proc, GC_is_valid_displacement_print_proc, GC_is_visible_print_proc): Move the declaration upper (to be right after GC_get_finalizer_notifier); improve comment; add GC_ATTR_DEPRECATED attribute. * include/gc/gc.h (GC_valid_ptr_print_proc_t, GC_same_obj_print_proc_t): New public type. * include/gc/gc.h (GC_same_obj_print_proc): Use GC_same_obj_print_proc_t type. * ptr_chck.c (GC_same_obj_print_proc): Likewise. * include/gc/gc.h (GC_is_valid_displacement_print_proc, GC_is_visible_print_proc): Use GC_valid_ptr_print_proc_t type. * ptr_chck.c (GC_is_valid_displacement_print_proc, GC_is_visible_print_proc): Likewise. * include/gc/gc.h (GC_set_same_obj_print_proc, GC_get_same_obj_print_proc, GC_set_is_valid_displacement_print_proc, GC_get_is_valid_displacement_print_proc, GC_set_is_visible_print_proc, GC_get_is_visible_print_proc): New public function declaration. * ptr_chck.c (GC_set_same_obj_print_proc, GC_get_same_obj_print_proc, GC_set_is_valid_displacement_print_proc, GC_get_is_valid_displacement_print_proc, GC_set_is_visible_print_proc, GC_get_is_visible_print_proc): New function definition. * tests/gctest.c [!DBG_HDRS_ALL] (set_print_procs): Use GC_set_is_valid_displacement_print_proc() and GC_set_is_visible_print_proc() instead of setting GC_is_valid_displacement_print_proc and GC_set_is_visible_print_proc variables. * tests/gctest.c [GC_PTHREADS] (main): Call GC_get_is_valid_displacement_print_proc(), GC_get_is_visible_print_proc(), GC_get_same_obj_print_proc() and GC_set_same_obj_print_proc().
* Better document preprocessor-related pointer checking routines in gc.hIvan Maidanski2023-01-301-24/+1
| | | | | | | | | | | | | | More detailed documentation of GC_same_obj, GC_is_visible and GC_is_valid_displacement in gc.h (by moving it from ptr_chck.c). * include/gc/gc.h (GC_oom_fn): Refine comment. * include/gc/gc.h (GC_same_obj): Move declaration down to be (near GC_is_visible). * include/gc/gc.h (GC_same_obj, GC_is_visible, GC_is_valid_displacement): Copy comment from ptr_chck.c; refine comment. * ptr_chck.c (GC_same_obj, GC_is_valid_displacement, GC_is_visible): Remove comment.
* Check highest bit of word using SIGNB instead of cast to signed_wordIvan Maidanski2023-01-241-1/+1
| | | | | | | | | | | (refactoring) * allchblk.c (GC_merge_unmapped): Replace overflow check (signed_word)(sz1+sz2)>0 to !((sz1+sz2)&SIGNB). * allchblk.c (GC_freehblk): Likewise. * mark.c (GC_mark_from): Replace (signed_word)descr>=0 expression to !(descr&SIGNB). * ptr_chck.c (GC_is_visible): Likewise.
* Fix disabling of automatic dynamic libraries registrationIvan Maidanski2022-09-271-2/+4
| | | | | | | | | | Now, if GC_no_dls then GC_is_visible does not cause registration of dynamic libraries. * ptr_chck.c [!THREADS && (DYNAMIC_LOADING || MSWIN32 || MSWINCE || CYGWIN32 || PCR)] (GC_is_visible): Do not call GC_register_dynamic_libraries() followed by GC_is_static_root() if GC_no_dls.
* Remove extra space after comma in license termsIvan Maidanski2022-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (reformatting) * CMakeLists.txt: Remove an extra space after comma in license header comment. * Makefile.am: Likewise. * allchblk.c: Likewise. * alloc.c: Likewise. * backgraph.c: Likewise. * blacklst.c: Likewise. * checksums.c: Likewise. * configure.ac: Likewise. * cord/cordbscs.c: Likewise. * cord/cordprnt.c: Likewise. * cord/cordxtra.c: Likewise. * cord/tests/cordtest.c: Likewise. * cord/tests/de.c: Likewise. * cord/tests/de_cmds.h: Likewise. * cord/tests/de_win.c: Likewise. * cord/tests/de_win.h: Likewise. * cord/tests/de_win.rc: Likewise. * darwin_stop_world.c: Likewise. * dbg_mlc.c: Likewise. * dyn_load.c: Likewise. * extra/gc.c: Likewise. * extra/msvc_dbg.c: Likewise. * extra/pcr_interface.c: Likewise. * extra/real_malloc.c: Likewise. * finalize.c: Likewise. * fnlz_mlc.c: Likewise. * gc_badalc.cc: Likewise. * gc_cpp.cc: Likewise. * gc_dlopen.c: Likewise. * gcj_mlc.c: Likewise. * headers.c: Likewise. * include/gc/cord.h: Likewise. * include/gc/cord_pos.h: Likewise. * include/gc/ec.h: Likewise. * include/gc/gc.h: Likewise. * include/gc/gc_backptr.h: Likewise. * include/gc/gc_config_macros.h: Likewise. * include/gc/gc_disclaim.h: Likewise. * include/gc/gc_gcj.h: Likewise. * include/gc/gc_inline.h: Likewise. * include/gc/gc_mark.h: Likewise. * include/gc/gc_pthread_redirects.h: Likewise. * include/gc/gc_tiny_fl.h: Likewise. * include/gc/gc_typed.h: Likewise. * include/gc/gc_version.h: Likewise. * include/gc/javaxfc.h: Likewise. * include/gc/leak_detector.h: Likewise. * include/include.am: Likewise. * include/private/darwin_semaphore.h: Likewise. * include/private/darwin_stop_world.h: Likewise. * include/private/dbg_mlc.h: Likewise. * include/private/gc_alloc_ptrs.h: Likewise. * include/private/gc_atomic_ops.h: Likewise. * include/private/gc_hdrs.h: Likewise. * include/private/gc_locks.h: Likewise. * include/private/gc_pmark.h: Likewise. * include/private/gc_priv.h: Likewise. * include/private/gcconfig.h: Likewise. * include/private/pthread_stop_world.h: Likewise. * include/private/pthread_support.h: Likewise. * include/private/specific.h: Likewise. * include/private/thread_local_alloc.h: Likewise. * m4/gc_set_version.m4: Likewise. * mach_dep.c: Likewise. * malloc.c: Likewise. * mallocx.c: Likewise. * mark.c: Likewise. * mark_rts.c: Likewise. * misc.c: Likewise. * new_hblk.c: Likewise. * obj_map.c: Likewise. * os_dep.c: Likewise. * pthread_start.c: Likewise. * pthread_stop_world.c: Likewise. * pthread_support.c: Likewise. * ptr_chck.c: Likewise. * reclaim.c: Likewise. * specific.c: Likewise. * tests/atomicops.c: Likewise. * tests/cpp.cc: Likewise. * tests/disclaim.c: Likewise. * tests/disclaim_bench.c: Likewise. * tests/gctest.c: Likewise. * tests/tests.am: Likewise. * tests/weakmap.c: Likewise. * thread_local_alloc.c: Likewise. * tools/setjmp_t.c: Likewise. * tools/threadlibs.c: Likewise. * typd_mlc.c: Likewise. * win32_threads.c: Likewise. * LICENSE: Remove an extra space after comma in license terms.
* Remove extra parentheses in return statementIvan Maidanski2022-05-011-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (refactoring) Also, replace 0 to NULL where appropriate. * allchblk.c (setup_header, GC_get_first_part, GC_allochblk_nth): Remove outermost parentheses in the expression of return statement. * alloc.c (GC_never_stop_func, GC_timeout_stop_func, GC_adj_bytes_allocd, GC_try_to_collect_inner, GC_collect_a_little, GC_stopped_mark, GC_try_to_collect_general, GC_expand_hp_inner, GC_collect_or_expand, GC_allocobj): Likewise. * blacklst.c (GC_is_black_listed, GC_number_stack_black_listed, total_stack_black_listed): Likewise. * checksums.c (GC_checksum): Likewise. * cord/cordbscs.c (CORD_cat_char_star, CORD_cat, CORD_len, CORD_index_access_fn, CORD_apply_access_fn, CORD_substr_checked, CORD_substr, CORD_iter5, CORD_iter, CORD_riter4, CORD_riter, CORD_concat_forest, CORD_balance, CORD__pos_fetch, CORD__prev, CORD_prev, CORD_pos_to_cord, CORD_pos_valid): Likewise. * cord/cordprnt.c (extract_conv_spec, CORD_vsprintf, CORD_sprintf, CORD_fprintf, CORD_vfprintf, CORD_printf, CORD_vprintf): Likewise. * cord/cordxtra.c (CORD_cat_char, CORD_catn, CORD_fill_proc, CORD_batched_fill_proc, CORD_cmp, CORD_ncmp, CORD_to_char_star, CORD_from_char_star, CORD_to_const_char_star, CORD_fetch, CORD_put_proc, CORD_batched_put_proc, CORD_put, CORD_chr_proc, CORD_rchr_proc, CORD_batched_chr_proc, CORD_chr, CORD_rchr, CORD_str, CORD_from_file_eager, CORD_lf_func, CORD_from_file_lazy_inner, CORD_from_file_lazy, CORD_from_file): Likewise. * cord/tests/cordtest.c (test_fn, id_cord_fn, test_basics): Likewise. * cord/tests/de.c (line_pos, add_hist, retrieve_line, beep): Likewise. * cord/tests/de_win.c (WinMain, plain_chars, control_chars, WndProc): Likewise. * dbg_mlc.c (store_debug_info, GC_debug_generic_malloc, GC_debug_generic_malloc, GC_debug_realloc, GC_make_closure): Likewise. * dyn_load.c (GC_FirstDLOpenedLinkMap): Likewise. * extra/real_malloc.c (real_malloc): Likewise. * finalize.c (GC_register_disappearing_link, GC_unregister_disappearing_link): Likewise. * gc_dlopen.c (dlopen): Likewise. * gcj_mlc.c (maybe_finalize, GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise. * headers.c (GC_find_header, alloc_hdr, get_index, GC_install_header, GC_next_block, GC_prev_block): Likewise. * malloc.c (GC_generic_malloc): Likewise. * mallocx.c (GC_realloc, GC_generic_malloc_ignore_off_page): Likewise. * mark.c (GC_collection_in_progress, GC_mark_some, GC_signal_mark_stack_overflow, GC_block_was_dirty, GC_push_next_marked, GC_push_next_marked_dirty, GC_push_next_marked_uncollectable): Likewise. * mark_rts.c (GC_is_static_root, rt_hash, GC_roots_present, GC_remove_tmp_roots, GC_approx_sp): Likewise. * misc.c (GC_default_oom_fn, GC_clear_stack_inner, GC_base, GC_write, GC_get_warn_proc, GC_call_with_alloc_lock): Likewise. * new_hblk.c (GC_build_fl_clear2, GC_build_fl_clear4, GC_build_fl2, GC_build_fl4, GC_build_fl): Likewise. * obj_map.c (GC_register_displacement_inner): Likewise. * os_dep.c (GC_find_limit_openbsd, GC_skip_hole_openbsd, GC_get_writable_length, GC_get_writable_length, GC_get_main_stack_base, GC_FreeBSDGetDataStart, GC_unix_mmap_get_mem, GC_unix_sbrk_get_mem, os2_alloc, GC_wince_get_mem, GC_win32_get_mem, GC_push_thread_stack, GC_push_old_obj, GC_write_fault_handler, catch_exception_raise_state, catch_exception_raise_state_identity): Likewise. * pthread_support.c (GC_new_thread, GC_lookup_thread, GC_get_nprocs, pthread_sigmask, pthread_create): Likewise. * ptr_chck.c (GC_same_obj, GC_default_is_visible_print_proc, GC_default_is_valid_displacement_print_proc, GC_is_visible, GC_pre_incr, GC_post_incr): Likewise. * reclaim.c (GC_block_empty, GC_reclaim_uninit, GC_n_set_marks, GC_reclaim_all): Likewise. * tests/cpp.cc (main): Likewise. * tests/gctest.c (fake_gcj_mark_proc, reverse1, reverse, ints, gcj_reverse1, gcj_reverse, gcj_ints, uncollectable_ints, mktree, alloc8bytes, main, test): Likewise. * tools/if_mach.c (main): Likewise. * tools/if_not_there.c (main): Likewise. * tools/setjmp_t.c (getpagesize, main, g): Likewise. * typd_mlc.c (GC_add_ext_descriptor, GC_add_ext_descriptor, GC_double_descr, GC_make_array_descriptor, GC_make_sequence_descriptor, GC_typed_mark_proc, GC_descr_obj_size, GC_push_complex_descriptor, GC_array_mark_proc, GC_make_descriptor, GC_calloc_explicitly_typed): Likewise. * win32_threads.c (GC_new_thread, GC_lookup_thread_inner, GC_get_stack_min, GC_pthread_create, GC_pthread_start_inner): Likewise. * allchblk.c (GC_get_first_part, GC_allochblk_nth): Replace 0 to NULL where appropriate. * alloc.c (GC_allocobj): Likewise. * blacklst.c (GC_is_black_listed): Likewise. * cord/cordbscs.c (CORD_from_fn_inner, CORD_substr_checked): Likewise. * cord/cordxtra.c (CORD_cat_char, CORD_to_char_star, CORD_from_char_star, CORD_lf_func, CORD_from_file_lazy_inner): Likewise. * dbg_mlc.c (store_debug_info, GC_debug_generic_malloc, GC_debug_generic_malloc): Likewise. * dyn_load.c (GC_FirstDLOpenedLinkMap): Likewise. * gcj_mlc.c (GC_debug_gcj_malloc): Likewise. * headers.c (GC_next_block, GC_prev_block): Likewise. * malloc.c (GC_generic_malloc, strdup): Likewise. * mallocx.c (GC_realloc): Likewise. * misc.c (GC_default_oom_fn, GC_base): Likewise. * os_dep.c (GC_get_main_stack_base, os2_alloc, GC_win32_get_mem): Likewise. * pthread_support.c (GC_new_thread, GC_lookup_thread): Likewise. * ptr_chck.c (GC_same_obj, GC_is_visible, GC_default_is_valid_displacement_print_proc): Likewise. * tests/gctest.c (mktree): Likewise. * typd_mlc.c (GC_make_array_descriptor, GC_push_complex_descriptor, GC_array_mark_proc, GC_calloc_explicitly_typed): Likewise. * win32_threads.c (GC_new_thread, GC_lookup_thread_inner): Likewise. * alloc.c (GC_never_stop_func, GC_timeout_stop_func): Replace 0 and 1 (in return statement) to FALSE and TRUE, respectively. * include/private/gcconfig.h: Remove outermost parentheses in the expression of return statement in comment.
* Adjust indentation in C preprocessor directivesIvan Maidanski2022-04-181-14/+14
| | | | | | | | | | | | | | | | | | | | | | | (reformatting) * cord/tests/de.c: Adjust indentation in directives. * cord/tests/de_win.c: Likewise. * dbg_mlc.c: Likewise. * dyn_load.c: Likewise. * extra/AmigaOS.c: Likewise. * include/gc/ec.h: Likewise. * include/gc/gc_tiny_fl.h: Likewise. * include/private/gc_locks.h: Likewise. * include/private/gc_priv.h: Likewise. * include/private/gcconfig.h: Likewise. * include/private/thread_local_alloc.h: Likewise. * malloc.c: Likewise. * mark.c: Likewise. * os_dep.c: Likewise. * ptr_chck.c: Likewise. * reclaim.c: Likewise. * tests/gctest.c: Likewise. * tools/threadlibs.c: Likewise.
* Do not call SET_HDR() to remove forwarding counts if none exists in hblkIvan Maidanski2021-12-021-4/+0
| | | | | | | | | | | | Issue #237 (bdwgc). This also prevents writing zeros to GC_all_nils by GC_remove_counts(). * headers.c (GC_remove_counts): If HDR(h+1) is zero (and sz is at least one block) then assert that HDR() of other hbp elements is zero too and then return (w/o SET_HDR(hbp,0) invocation). * ptr_chck.c (GC_is_valid_displacement): Remove comment that if(p) is needed to avoid a data race.
* Workaround Thread Sanitizer (TSan) FP warning in is_valid_displacementIvan Maidanski2021-12-011-0/+5
| | | | | | | Issue #237 (bdwgc). * ptr_chck.c (GC_is_valid_displacement): Avoid passing NULL to HDR(p); add comment.
* Fix GC_is_valid_displacement and GC_is_visible for non-small objectsIvan Maidanski2018-07-111-6/+8
| | | | | | | | | | * ptr_chck.c (GC_is_valid_displacement): Remove redundant IS_FORWARDING_ADDR_OR_NIL(hhdr) call if GC_all_interior_pointers. * ptr_chck.c (GC_is_valid_displacement): Do not goto fail if p+sz-offset > h+1 but IS_FORWARDING_ADDR_OR_NIL(HDR(h+1)). * ptr_chck.c (GC_is_visible): Transform comment about GC_base to a TODO item; set hhdr to HDR(base) instead of HDR(p) if HBLKPTR(base)!=HBLKPTR(p).
* Convert GC source files to valid C++ codeIvan Maidanski2018-02-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #206 (bdwgc). * alloc.c (GC_copyright): Change type from char* const to const char* const. * alloc.c (GC_set_fl_marks, GC_clear_fl_marks, GC_finish_collection, GC_allocobj): Add missing explicit casts from void* to ptr_t. * backgraph.c [MAKE_BACK_GRAPH] (add_back_edges): Likewise. * blacklst.c (GC_default_print_heap_obj_proc, GC_print_blacklisted_ptr): Likewise. * dbg_mlc.c (GC_get_back_ptr_info, GC_store_debug_info_inner, GC_store_debug_info, GC_debug_malloc, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_generic_malloc, GC_debug_malloc_stubborn, GC_debug_malloc_atomic, GC_debug_malloc_uncollectable, GC_debug_malloc_atomic_uncollectable, GC_debug_free, GC_debug_free_inner, GC_debug_register_finalizer, GC_debug_register_finalizer_no_order, GC_debug_register_finalizer_unreachable, GC_debug_register_finalizer_ignore_self): Likewise. * finalize.c (GC_grow_table, push_and_mark_object, ensure_toggleref_capacity, GC_dump_finalization_links, GC_dump_finalization, GC_make_disappearing_links_disappear, GC_remove_dangling_disappearing_links, GC_finalize): Likewise. * gcj_mlc.c (GC_gcj_malloc, GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise. * include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Likewise. * mallocx.c (GC_memalign): Likewise. * mark.c (GC_mark_from, GC_mark_and_push, GC_push_all_eager, GC_push_all_stack, GC_push_marked1, GC_push_marked2, GC_push_marked4): Likewise. * mark_rts.c (GC_exclude_static_roots_inner): Likewise. * misc.c (GC_base): Likewise. * new_hblk.c (GC_new_hblk): Likewise. * pthread_support.c (GC_register_altstack, GC_thr_init, GC_record_stack_base): Likewise. * ptr_chck.c (GC_is_visible): Likewise. * reclaim.c (GC_reclaim_small_nonempty_block, GC_disclaim_and_reclaim_or_free_small_block): Likewise. * thread_local_alloc.c (GC_mark_thread_local_fls_for): Likewise. * typd_mlc.c (GC_typed_mark_proc, GC_malloc_explicitly_typed_ignore_off_page): Likewise. * win32_threads.c (GC_record_stack_base, GC_get_stack_min, GC_push_stack_for): Likewise. * blacklst.c (GC_copy_bl): Rename "new" argument to "dest". * dbg_mlc.c (GC_store_debug_info_inner, GC_print_smashed_obj): Change type of p argument from ptr_t to void*. * include/private/gc_priv.h (GC_is_heap_base, GC_is_static_root): Likewise. * mark_rts.c [!THREADS] (GC_is_static_root): Likewise. * os_dep.c (GC_is_malloc_heap_base, GC_is_heap_base): Likewise. * ptr_chck.c (GC_on_stack): Likewise. * dbg_mlc.c (GC_print_obj): Change type of kind_str local variable from char* to const char*. * dbg_mlc.c (GC_debug_strdup, GC_debug_strndup): Cast result of GC_debug_malloc_atomic() to char*. * mallocx.c (GC_strdup, GC_strndup): Likewise. * dbg_mlc.c (GC_debug_wcsdup): Cast result of GC_debug_malloc_atomic() to wchar_t*. * mallocx.c (GC_wcsdup): Likewise. * dyn_load.c [MSWIN32 || MSWINCE || CYGWIN32] (GC_register_dynamic_libraries): Cast p local variable to char*. * os_dep.c (GC_register_data_segments): Likewise. * fnlz_mlc.c [ENABLE_DISCLAIM] (GC_finalized_disclaim): Cast masked fc_word to struct GC_finalizer_closure* (instead of void*). * fnlz_mlc.c [ENABLE_DISCLAIM] (GC_finalized_malloc): Cast result of GC_malloc_kind() to word*. * typd_mlc.c (GC_malloc_explicitly_typed, GC_calloc_explicitly_typed): Likewise. * include/private/gc_priv.h (WARN): Cast away const qualifier for msg (and the string literal). * misc.c (GC_default_on_abort): Remove cast to void* for WRITE() buf argument. * misc.c (GC_new_free_list_inner): Cast result local variable to void**. * misc.c (GC_new_free_list): Change type of result local variable from void* to void**. * pthread_support.c (GC_start_rtn_prepare_thread): Cast arg to struct start_info*. * win32_threads.c [GC_PTHREADS] (GC_pthread_start_inner): Likewise. * reclaim.c (GC_print_free_list): Replace ptr_t flh to void *flh_next local variable; remove redundant casts. * tools/if_mach.c (EXECV_ARGV_T): New macro; add comment. * tools/if_not_there.c (EXECV_ARGV_T): Likewise. * tools/if_mach.c (main): Use EXECV_ARGV_T instead of void* for execvp() argument. * tools/if_not_there.c (main): Likewise. * typd_mlc.c (LeafDescriptor, ComplexArrayDescriptor, SequenceDescriptor): Move struct definition out of union ComplexDescriptor. * typd_mlc.c (GC_add_ext_descriptor): Rename "new" local variable to newExtD. * win32_threads.c (GC_CreateThread, GC_beginthreadex): Cast result of GC_malloc_uncollectable() to thread_args*. * win32_threads.c [PARALLEL_MARK && !MSWINCE && __cplusplus] (GC_thr_init): Do not cast GetProcessAffinityMask() arguments to void*.
* Fix various typos in comments and documentationIvan Maidanski2016-08-011-1/+1
| | | | | | | | | | | | * doc/README.Mac: Fix typo (replace "it's" to "its"). * doc/debugging.html: Likewise. * doc/gcdescr.html: Fix typo ("it performs"). * include/private/gcconfig.h: Fix typo in comment ("its"). * mark.c (INITIAL_MARK_STACK_SIZE): Fix typo in comment ("it wants"). * mark.c (GC_mark_from): Fix typo in comment (double "it"). * misc.c (GC_SLOP): Fix typo in comma (double "saw"). * os_dep.c (GC_get_file_len): Fix typo in comment (missing "buffer"). * ptr_chck.c (GC_is_visible): Add missing comma in comment.
* Fix more typos in comments and documentationIvan Maidanski2013-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alloc.c: Fix typo ("overflow"). * configure.ac: Fix typo ("optimization"). * doc/README.amiga: Fix typos ("also", "specific", "unnecessary"). * doc/README.cords: Fix typos ("descendants", "highlighted"). * ChangeLog: Fix typos ("[un]collectible"). * README.md: Likewise. * dbg_mlc.c: Likewise. * doc/README.hp: Likewise. * doc/README.linux: Likewise. * doc/gcdescr.html: Likewise. * doc/gcinterface.html: Likewise. * include/gc_mark.h: Likewise. * include/gc_pthread_redirects.h: Likewise. * include/new_gc_alloc.h: Likewise. * include/private/dbg_mlc.h: Likewise. * include/private/gc_pmark.h: Likewise. * include/private/gc_priv.h: Likewise. * new_hblk.c: Likewise. * ChangeLog: Fix typo ("multi-threaded"). * cord/cordxtra.c: Likewise. * doc/debugging.html: Likewise. * doc/gcinterface.html: Likewise. * doc/leak.html: Likewise. * doc/overview.html: Likewise. * doc/simple_example.html: Likewise. * include/gc_mark.h: Likewise. * include/private/gc_priv.h: Likewise. * os_dep.c: Likewise. * ptr_chck.c: Likewise. * README.md: Fix typo ("pointer-free"). * allchblk.c: Likewise. * doc/debugging.html: Likewise. * doc/gcdescr.html: Likewise.
* Adjust punctuation in comments and documentationIvan Maidanski2013-01-231-2/+2
| | | | | | | | | * win32_threads.c (GC_pthread_join): Add a space character after comma in comment. * include/private/gcconfig.h: Likewise. * doc/README.Mac: Likewise. * doc/porting.html: Likewise. * ptr_chck.c (GC_same_obj): Remove redundant comma in comment.
* Replace GC_log/err_printf() followed by ABORT with ABORT_ARGn()Ivan Maidanski2012-12-111-6/+4
| | | | | | | | | | | | | | | | | | | | | | (code refactoring) * allchblk.c (GC_freehblk): Replace GC_COND_LOG_PRINTF (or GC_log_printf, or GC_err_printf) followed by ABORT with ABORT_ARG<n> (where 'n' is the number of arguments matching format string). * alloc.c (GC_check_fl_marks): Likewise. * dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change, GC_debug_free, GC_debug_realloc): Likewise. * dyn_load.c (GC_register_dynamic_libraries): Likewise. * os_dep.c (GC_get_maps, GC_register_data_segments, GC_remap, PROTECT, GC_write_fault_handler, GC_mprotect_thread): Likewise. * pthread_stop_world.c (GC_suspend_all, GC_start_world): Likewise. * ptr_chck.c (GC_default_same_obj_print_proc, GC_default_is_valid_displacement_print_proc, GC_default_is_visible_print_proc): Likewise. * specific.c (GC_check_tsd_marks): Likewise. * win32_threads.c (GC_register_my_thread_inner): Likewise. * include/private/gc_priv.h (ABORT_ARG1, ABORT_ARG2, ABORT_ARG3): New macro.
* Fix all address-of-dummy operations by using GC_approx_sp() insteadIvan Maidanski2012-08-011-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (previous commit 'd6acbda' has not solved this problem) * alloc.c (min_bytes_allocd, GC_stopped_mark): Use GC_approx_sp() instead of "&dummy"; remove 'dummy' local variable. * dyn_load.c (GC_cond_add_roots): Likewise. * misc.c (GC_init): Likewise. * os_dep.c (GC_get_stack_base, GC_get_main_stack_base): Likewise. * pthread_stop_world.c (GC_suspend_handler_inner, nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Likewise. * pthread_support.c (GC_thr_init): Likewise. * ptr_chck.c (GC_on_stack): Likewise. * win32_threads.c (GC_push_stack_for): Likewise. * misc.c (GC_clear_stack_inner): Store address of volatile 'dummy' local array (i.e. 'sp' value) to its first element (and use it in the comparison of addresses) to prevent any harmful optimizations as C officially disallows comparisons of pointers to different objects (e.g., some Mac OS X clang releases might turn a conditional expression that uses 'dummy' address into a constant); update comment. * misc.c (GC_call_with_stack_base): Use "&base" instead of "&dummy" (it is safe to use address of base here); remove dummy variable. * os_dep.c (currently_updating): Change type from "word" to "int*". * os_dep.c (async_set_pht_entry_from_index): Remove volatile and casts for 'update_dummy' local variable. * tools/setjmp_t.c (main): Define volatile 'sp' local variable, store its address to it and use it instead of "&dummy"; remove 'dummy' local variable.
* Fix all address-of-dummy operations by adding volatileIvan Maidanski2012-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alloc.c (min_bytes_allocd, GC_stopped_mark): Use volatile for 'dummy' local variable (used to get 'sp' value) to prevent any harmful optimizations (e.g., some Mac OS X clang releases might turn a conditional expression that uses 'dummy' address into a constant). * dyn_load.c (GC_cond_add_roots): Likewise. * mach_dep.c (GC_with_callee_saves_pushed): Likewise. * misc.c (GC_clear_stack_inner, GC_init, GC_call_with_stack_base): Likewise. * os_dep.c (GC_get_stack_base, GC_get_main_stack_base, async_set_pht_entry_from_index): Likewise. * pthread_stop_world.c (nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Likewise. * pthread_support.c (GC_thr_init): Likewise. * ptr_chck.c (GC_on_stack): Likewise. * tools/setjmp_t.c (main): Likewise. * win32_threads.c (GC_push_stack_for): Likewise. * dyn_load.c (dummy): Change variable type from char to int. * include/private/gcconfig.h: Update comment about GC_stackbottom initialization. * os_dep.c (GC_get_stack_base): Remove 'sp' local variable. * os_dep.c (GC_get_main_stack_base): Define and use volatile 'dummy' variable (instead of 'result') to get 'sp' value (revert part of commit bddc75f). * os_dep.c (GC_get_stack_base): Add missing cast of 'dummy' address (only if NEED_FIND_LIMIT). * pthread_stop_world.c (GC_suspend_handler_inner): Define and use volatile 'dummy' variable (instead of 'me') to get 'sp' value (revert part of commit 31fc0f6). * pthread_stop_world.c (nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Rename 'local_dummy' to 'dummy' local variable.
* Replace pointer relational comparisons with non-pointer onesIvan Maidanski2012-03-051-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * allchblk.c (GC_dump_regions, GC_allochblk_nth): Cast pointers to word type in relational (less-greater) comparisons. * alloc.c (GC_add_to_heap, GC_print_heap_sects, 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_push_all_stacks): Likewise. * dbg_mlc.c (GC_get_back_ptr_info, GC_print_smashed_obj, GC_check_heap_block): Likewise. * dyn_load.c (sort_heap_sects, GC_register_map_entries, GC_register_dynlib_callback, GC_register_dynamic_libraries_dl_iterate_phdr, GC_register_dynamic_libraries, 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 (PUSH_OBJ, PUsH_CONTENTS_HDR, GC_PUSH_ONE_STACK, GC_PUSH_ONE_HEAP, GC_mark_stack_empty): Likewise. * include/private/gc_priv.h (MAKE_COOLER, COOLER_THAN): Likewise. * mach_dep.c (GC_with_callee_saves_pushed): Likewise. * malloc.c (calloc, free): 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_push_selected, GC_push_all_eager, GC_push_marked1, GC_push_marked2, GC_push_marked4, GC_push_marked, GC_push_unconditionally): Likewise. * mark_rts.c (GC_is_static_root, GC_add_roots_inner, GC_remove_roots_inner, GC_is_tmp_root, GC_exclude_static_roots_inner, GC_push_conditional_with_exclusions, GC_push_all_register_sections, GC_push_all_stack_sections, GC_push_all_stack_partially_eager, GC_push_all_stack_part_eager_sections, GC_push_current_stack): Likewise. * misc.c (GC_clear_stack_inner, GC_clear_stack, GC_base, GC_call_with_gc_active): 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_enclosing_mapping, GC_text_mapping, tiny_sbrk, GC_find_limit_openbsd, GC_skip_hole_openbsd, GC_find_limit_with_bound, GC_get_main_stack_base, GC_get_stack_base, GC_least_described_address, GC_register_root_section, GC_register_data_segments, GC_unmap_start, GC_gww_read_dirty, GC_remove_protection, GC_protect_heap, GC_unprotect_range, GC_read_dirty, GC_page_was_dirty, GC_save_callers, GC_print_callers): Likewise. * pcr_interface.c (GC_enumerate_block): Likewise. * pthread_support.c (GC_is_thread_tsd_valid, GC_segment_is_thread_stack, GC_greatest_stack_base_below, GC_call_with_gc_active): Likewise. * ptr_chck.c (GC_same_obj, GC_is_valid_displacement, GC_on_stack, GC_is_visible): Likewise. * reclaim.c (GC_reclaim_clear, GC_reclaim_uninit, GC_disclaim_and_reclaim, GC_reclaim_check, GC_start_reclaim): Likewise. * tests/test.c (cons): Likewise. * tools/setjmp_t.c (main): Likewise. * typd_mlc.c (GC_typed_mark_proc): Likewise. * win32_threads.c (GC_is_thread_tsd_valid, GC_call_with_gc_active, GC_push_stack_for, GC_get_next_stack): Likewise. * extra/msvc_dbg.c (GetDescriptionFromAddress, GetDescriptionFromStack): Cast pointers to GC_ULONG_PTR in relational comparisons. * include/gc.h (GC_DATASTART, GC_DATAEND): Cast pointers to GC_word in relational comparisons. * misc.c (GC_init): Remove static assertion on ((ptr_t)-1 > 0) since no longer required; add the comment. * pcr_interface.c: Expand tabs to spaces.
* Use EXPECT for checking various 'initialized' boolean variablesIvan Maidanski2011-12-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Resolve "comparison of signed and unsigned values" compiler warnings.Ivan Maidanski2011-08-211-1/+1
| | | | | | | | | | | | | | | | | * allchblk.c (GC_allochblk_nth): Cast MAX_BLACK_LIST_ALLOC and HBLKSIZE to signed_word. * mallocx.c (GC_generic_malloc_many): Cast my_bytes_allocd to word. * mark.c (GC_do_local_mark): Cast the result of local_top minus local_mark_stack to word (since is non-negative). * misc.c (GC_base): Declare sz as unsigned word. * misc.c (GC_enable_incremental): Cast bytes_written to size_t in comparison to len. * obj_map.c (GC_initialize_offsets): Declare 'i' as unsigned. * os_dep.c (GC_or_pages): Ditto. * typd_mlc.c (GC_init_explicit_typing): Ditto. * ptr_chck.c (GC_is_visible): Cast the result of p minus base to word. * typd_mlc.c (GC_make_descriptor): Cast last_set_bit to word (since non-negative) when compared to BITMAP_BITS.
* 2011-04-26 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | * alloc.c: Don't include sys/types.h for ArmCC. * dyn_load.c: Ditto. * os_dep.c: Ditto. * mach_dep.c (_setjmp, _longjmp): Redirect to setjmp/longjmp for ArmCC. * mark.c (GC_noop): Define specially for ArmCC. * include/private/gc_priv.h (GC_noop): Ditto. * misc.c (GC_init): Don't test pointers comparison for ArmCC. * misc.c: Don't include unistd.h for ArmCC. * os_dep.c (pages_executable): Rename to GC_pages_executable; make STATIC. * os_dep.c (GC_unix_mmap_get_mem): Don't define for ArmCC. * ptr_chck.c (GC_is_visible): Explicitly cast (GC_DS_PER_OBJECT-GC_INDIR_PER_OBJ_BIAS) to word (to suppress a compiler warning). * include/private/gcconfig.h: Recognize __arm. * include/private/gcconfig.h (HBLKPTR): Define for ArmCC. * include/private/gcconfig.h (HBLKPTR): Add parentheses for "bytes" argument.
* 2010-03-19 Ivan Maidanski <ivmai@mail.ru> (really Dave Korn)ivmai2011-07-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dyn_load.c (GC_get_next_stack, GC_cond_add_roots): Define for Cygwin as well as other win32 targets. * dyn_load.c (GC_wnt): Define to constant true. * dyn_load.c (GC_register_dynamic_libraries): Define for Cygwin as well as other win32 targets. * mark_rts.c (rt_hash, GC_roots_present, add_roots_to_index): Don't define for Cygwin, as on other win32. * mark_rts.c (GC_add_roots_inner, GC_clear_roots): Handle on Cygwin as for other win32 targets. * mark_rts.c (GC_rebuild_root_index): Don't declare on Cygwin, as other win32. * mark_rts.c (GC_remove_tmp_roots): Do declare on Cygwin as on other win32. * mark_rts.c (GC_remove_roots, GC_remove_roots_inner): Don't declare on Cygwin as on other win32. * mark_rts.c (GC_is_tmp_root): Do declare on Cygwin when !NO_DEBUGGING, as on other win32 targets. * mark_rts.c (GC_cond_register_dynamic_libraries): Handle on Cygwin as for other win32 targets. * os_dep.c (GC_setpagesize): Handle on Cygwin as on other win32. * os_dep.c (GC_get_main_stack_base): Don't declare on Cygwin, as other win32. * os_dep.c (GC_sysinfo): Declare on Cygwin, as other win32. * os_dep.c (GC_win32_get_mem): Declare on Cygwin, as on other Win32, but call GC_unix_get_mem instead of GlobalAlloc. * os_dep.c (GC_win32_free_heap): Declare on Cygwin (as empty). * ptr_chck.c (GC_is_visible): Register dynamic libraries on Cygwin as on other win32 platforms. * win32_threads.c (GC_get_next_stack): Define on Cygwin as well as for dynamic loading targets. * include/private/gc_priv.h (GC_INNER): Don't try to use visibility on Cygwin which does not support it. * include/private/gc_priv.h (struct roots): Don't declare r_next member on Cygwin as on other windows hosts. * include/private/gc_priv.h (LOG_RT_SIZE, RT_SIZE): Don't define likewise. * include/private/gc_priv.h (struct _GC_arrays): Do declare _heap_bases[] member and don't declare _root_index likewise. * include/private/gc_priv.h (GC_heap_bases): Do define likewise. * include/private/gc_priv.h (_SYSTEM_INFO): Do forward-declare likewise. * include/private/gc_priv.h (GC_sysinfo): Do declare extern likewise. * include/private/gcconfig.h (GC_win32_get_mem, GET_MEM): Do prototype on Cygwin as other win32 platforms.
* 2009-10-21 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * allchblk.c (DEBUG): Remove macro (since unused). * allchblk.c: Include private/gc_priv.h before other includes and definitions. * alloc.c: Ditto. * gc_dlopen.c: Ditto. * headers.c: Ditto. * mallocx.c: Ditto. * mark_rts.c: Ditto. * new_hblk.c: Ditto. * reclaim.c: Ditto. * mark.c: Include private/gc_pmark.h before other includes. * misc.c: Ditto. * dyn_load.c (_GNU_SOURCE): Move the definition to gc_priv.h. * pthread_support.c (_USING_POSIX4A_DRAFT10): Ditto. * pthread_support.c (_POSIX4A_DRAFT10_SOURCE): Remove (since already defined in gc_config_macros.h). * dyn_load.c (GC_init_dyld): Remove parameter cast for _dyld_register_func_for_add_image() and _dyld_register_func_for_remove_image(); add the comment about possible warnings; add FIXME for the deprecated _dyld_bind_fully_image_containing_address(). * include/private/gc_priv.h: Include gc.h before the standard headers inclusion. * tests/test.c: Ditto. * include/private/gcconfig.h (DebugBreak): Update the comment. * typd_mlc.c (ED_INITIAL_SIZE): Remove ';'. * alloc.c: Reformat the code (partly adjust indentation). * backgraph.c: Ditto. * blacklst.c: Ditto. * checksums.c: Ditto. * finalize.c: Ditto. * gcj_mlc.c: Ditto. * mach_dep.c: Ditto. * mark_rts.c: Ditto. * obj_map.c: Ditto. * os_dep.c: Ditto. * ptr_chck.c: Ditto. * stubborn.c: Ditto. * thread_local_alloc.c: Ditto. * typd_mlc.c: Ditto.
* 2009-09-16 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-130/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ChangeLog: Remove trailing spaces at EOLn; insert blank lines where missed. * doc/README: Expand all tabs to spaces; remove trailing spaces at EOLn; remove multiple trailing blank lines. * doc/README.autoconf: Ditto. * doc/README.DGUX386: Ditto. * doc/README.environment: Ditto. * doc/README.macros: Ditto. * doc/README.win32: Ditto. * tests/test.c: Ditto. * tests/test_cpp.cc: Ditto. * backgraph.c: Ditto. * blacklst.c: Ditto. * checksums.c: Ditto. * darwin_stop_world.c: Ditto. * dbg_mlc.c: Ditto. * dyn_load.c: Ditto. * finalize.c: Ditto. * gc_dlopen.c: Ditto. * gcj_mlc.c: Ditto. * headers.c: Ditto. * mach_dep.c: Ditto. * malloc.c: Ditto. * mallocx.c: Ditto. * new_hblk.c: Ditto. * obj_map.c: Ditto. * ptr_chck.c: Ditto. * real_malloc.c: Ditto. * reclaim.c: Ditto. * stubborn.c: Ditto. * thread_local_alloc.c: Ditto. * typd_mlc.c: Ditto. * gc_cpp.cc: Ditto. * include/gc_allocator.h: Ditto. * include/gc_backptr.h: Ditto. * include/gc_config_macros.h: Ditto. * include/gc_cpp.h: Ditto. * include/gc_gcj.h: Ditto. * include/gc_inline.h: Ditto. * include/gc_mark.h: Ditto. * include/gc_pthread_redirects.h: Ditto. * include/gc_typed.h: Ditto. * include/gc_version.h: Ditto. * include/javaxfc.h: Ditto. * include/new_gc_alloc.h: Ditto. * include/private/darwin_semaphore.h: Ditto. * include/private/dbg_mlc.h: Ditto. * include/private/gc_hdrs.h: Ditto. * include/private/gc_locks.h: Ditto. * include/private/gc_pmark.h: Ditto. * include/private/gcconfig.h: Ditto. * include/private/pthread_support.h: Ditto. * include/private/thread_local_alloc.h: Ditto. * darwin_stop_world.c: Add copyright header. * include/gc_backptr.h: Ditto. * include/gc_config_macros.h: Ditto. * include/gc_pthread_redirects.h: Ditto. * include/gc_version.h: Ditto. * include/javaxfc.h: Ditto. * include/private/darwin_semaphore.h: Ditto. * include/private/pthread_support.h: Ditto. * gc_cpp.cc: Make copyright header uniform across the package. * include/gc_cpp.h: Ditto.
* 2008-11-07 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)hboehm2011-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (Mostly improves LLP64 support.) * backgraph.c, checksums.c, dbg_mlc.c, finalize.c, mark.c, misc.c, reclaim.c: Changed some int and long type to word or size_t (and vice versa where appropriate) * gcj_mlc.c, include/private/dbg_mlc.h, include/private/gcconfig.h, include/private/thread_local_alloc.h, mark.c, misc.c, thread_local_alloc.c, win32_threads.c: Added intermediate casts to word type when casting from int to pointer (or pointer to int, or data pointer to code pointer) - just to remove the corresponding compiler warning. * ptr_chck.c (GC_is_visible): cast int const to word type to prevent left shift overflow. * os_dep.c: change the type of GC_mem_top_down global var (containing a flag) to DWORD. * include/gc_config_macros.h: define GC_SOLARIS_THREADS if GC_THREADS is defined on SunOS x86_64. * misc.c (GC_init_size_map): Ifdef out GC_ASSERT as a workaround for VC++ 2008 amd64 (v15.00.21022.08 for x64) compiler bug (the compiler gets hung if invoked with -Ox -D ALL_INTERIOR_POINTERS -D GC_ASSERTIONS) * backgraph.c: cast GC_gc_no value to unsigned short when assigned/compared to height_gc_no field of back_edges. * os_dep.c (GC_remove_protection): Add ARGSUSED. * win32_threads.c (GC_thread_exit_proc): Remove unused local var. * mark.c (GC_check_dirty): Move declaration out of func body.
* 2008-10-24 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)hboehm2011-07-261-11/+12
| | | | | | | | | | | | * alloc.c, dbg_mlc.c, dyn_load.c, finalize.c, gcj_mlc.c, include/gc.h, include/gc_config_macros.h, include/gc_cpp.h, include/gc_gcj.h, include/gc_mark.h, include/gc_typed.h, include/javaxfc.h, include/private/gc_locks.h, include/private/gc_priv.h, malloc.c, mallocx.c, mark.c, mark_rts.c, misc.c, obj_map.c, os_dep.c, pthread_support.c, ptr_chck.c, stubborn.c, tests/test.c, thread_local_alloc.c, typd_mlc.c win32_threads.c: Add GC_CALL and GC_CALLBACK macro invocations. * test.c: Remove some old K&R code.
* 2008-08-26 Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)hboehm2011-07-261-4/+4
| | | | | | | | | | | | | * configure.ac: Check for gc-debug earlier; replace remaining full-debug tests. * configure: Regenerate. * include/gc.h, ptr_chck.c (GC_pre_incr, GC_post_incr): Use signed offset type. Use ptr_t internally. * doc/gcinterface.html: Update LOCAL_MALLOC description. * doc/README.autoconf, doc/leak.html, doc/README.DGUX386: Fix full-debug reference. * include/gc.h: Rewrite GC_..._INCR and friends. * tests/test.c: Minimally test GC_..._INCR and friends.
* 2008-07-25 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)hboehm2011-07-261-19/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ivan's description of the patch follows. Note that a few pieces like the GC_malloc(0) patch, were not applied since an alternate had been previously applied. A few differed stylistically from the rest of the code (mostly casts to void * instead of target type), or were classified as too minor to bother. Note that all of Ivan's static declarations which did not correct outright naming bugs (as a few did), where replaced by STATIC, which is ignored by default. - minor bug fixing (for FreeBSD, for THREAD_LOCAL_ALLOC and for GC_malloc(0)); - addition of missing getter/setter functions for public variables (may be useful if compiled as Win32 DLL); - addition of missing GC_API for some exported functions; - addition of missing "static" declarator for internal functions and variables (where possible); - replacement of all remaining K&R-style definitions with ANSI C ones (__STDC__ macro is not used anymore); - addition of some Win32 macro definitions (that may be missing in the standard headers supplied with a compiler) for GWW_VDB mode; - elimination of most compiler warnings (except for "uninitialized data" warning); - several typos correction; - missing parenthesis addition in macros in some header files of "libatomic_ops" module. My highlights based on reading the patch: * allchblk.c: Remove GC_freehblk_ptr decl. Make free_list_index_of() static. * include/gc.h: Use __int64 on win64, define GC_oom_func, GC_finalizer_notifier_proc, GC_finalizer_notifier_proc, add getter and setters: GC_get_gc_no, GC_get_parallel, GC_set_oom_fn, GC_set_finalize_on_demand, GC_set_java_finalization, GC_set_dont_expand, GC_set_no_dls, GC_set_max_retries, GC_set_dont_precollect, GC_set_finalizer_notifier. Always define GC_win32_free_heap. gc_config_macros.h: Define _REENTRANT after processing GC_THREADS. * include/gc_cpp.h: Improve GC_PLACEMENT_DELETE test, handling of operator new[] for old Windows compilers. * include/gc_inline.h (GC_MALLOC_FAST_GRANS): Add parentheses around arguments. * dbg_mlc.c, malloc.c, misc.c: Add many GC_API specs. * mark.c (GC_mark_and_push_stack): Fix source argument for blacklist printing. * misc.c: Fix log file naming based on environment variable for Windows. Make GC_set_warn_proc and GC_set_free_space_divisor just return current value with 0 argument. Add DONT_USER_USER32_DLL. Add various getters and setters as in gc.h. * os_dep.c: Remove no longer used GC_disable/enable_signals implementations. (GC_get_stack_base): Add pthread_attr_destroy call. No longer set GC_old_bus_handler in DARWIN workaround. * pthread_support.c: GC_register_my_thread must also call GC_init_thread_local.
* 2007-06-06 Hans Boehm <Hans.Boehm@hp.com>hboehm2011-07-261-2/+2
| | | | | | | | | | | | | | | | | | | * Makefile.am, Makefile.direct: Add NT_X64_STATIC_THREADS_MAKEFILE. * Makefile.in: Regenerate. * NT_X64_STATIC_THREADS_MAKEFILE: Fix warning flags. * allochblk.c, alloc.c, blacklst.c, dbg_malc.c, dyn_load.c, finalize.c, headers.c, mach_dep.c, malloc.c, mark.c, misc.c, obj_map.c, os_dep.c, ptr_chck.c, reclaim.c, typd_mlc.c, win32_threads.c, cord/de_win.c, include/gc_mark.h, include/private/gc_hdrs.h, include/private/gc_pmark.h, include/private/gc_priv.h, tests/test_cpp.cc: Replace old style function declarations. Clean up integral types. Remove register declarations. The change in malloc.c and the "int descr" declaration in mark.c are the most likely to have been real bugs outside of win64. * msvc_dbg.c: Disable on win64. * win32_threads.c: Add AMD64 support. * include/gc.h: no backtrace on AMD64 for now.
* gc7.0alpha2 tarball importgc7_0alpha2Ivan Maidanski2011-07-261-2/+1
|
* gc7.0alpha1 tarball importgc7_0alpha1Ivan Maidanski2011-07-261-85/+41
|
* gc6.2 tarball importgc6_2Ivan Maidanski2011-07-261-2/+2
|
* gc6.0 tarball importgc6_0Ivan Maidanski2011-07-261-40/+42
|
* gc4.13 tarball importgc4_13Ivan Maidanski2011-07-261-2/+2
|
* gc4.11 tarball importgc4_11Ivan Maidanski2011-07-261-10/+21
|
* gc4.8 tarball importgc4_8Ivan Maidanski2011-07-261-0/+315