summaryrefslogtreecommitdiff
path: root/checksums.c
Commit message (Collapse)AuthorAgeFilesLines
* Use cast to void instead of the attribute to indicate unused argumentsIvan Maidanski2022-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (refactoring) * CMakeLists.txt [BORLAND] (add_compile_options): Remove "/w-par"; reorder options. * CMakeLists.txt [!BORLAND && MSVC] (add_compile_options): Remove "/wd4100"; update comment. * NT_MAKEFILE (.c.obj): Likewise. * allchblk.c [!NO_DEBUGGING || GC_ASSERTIONS] (add_hb_sz): Use UNUSED_ARG() instead of GC_ATTR_UNUSED. * allchblk.c [USE_MUNMAP] (GC_adjust_num_unmapped): Likewise. * backgraph.c [MAKE_BACK_GRAPH] (pop_in_progress, reset_back_edge, update_max_height): Likewise. * checksums.c [CHECKSUMS] (GC_add_block): Likewise. * darwin_stop_world.c (GC_stack_range_for): Likewise. * dbg_mlc.c (GC_store_debug_info_inner, GC_debug_change_stubborn, GC_check_heap_block): Likewise. * finalize.c [!GC_NO_FINALIZATION] (GC_null_finalize_mark_proc): Likewise. * gcj_mlc.c [GC_GCJ_SUPPORT] (GC_gcj_fake_mark_proc): Likewise. * mallocx.c [!CPPCHECK] (GC_change_stubborn): Likewise. * mark.c (GC_noop6, clear_marks_for_block): Likewise. * mark.c [WRAP_MARK_SOME && (MSWIN32 || MSWINCE) && __GNUC__] (mark_ex_handler): Likewise. * mark.c [GC_DISABLE_INCREMENTAL] (GC_push_conditional): Likewise. * mark_rts.c (GC_push_current_stack, GC_push_roots): Likewise. * misc.c (GC_default_oom_fn, GC_set_handle_fork): Likewise. * misc.c [THREADS && !SIGNAL_BASED_STOP_WORLD] (GC_set_suspend_signal, GC_set_thr_restart_signal): Likewise. * misc.c [THREADS && UNIX_LIKE && !NO_GETCONTEXT] (callee_saves_pushed_dummy_fn): Likewise. * misc.c [!THREADS] (GC_do_blocking_inner): Likewise. * misc.c [!PARALLEL_MARK] (GC_set_markers_count): Likewise. * os_dep.c [OPENBSD] (GC_fault_handler_openbsd): Likewise. * os_dep.c [NEED_FIND_LIMIT || WRAP_MARK_SOME && !MSWIN32 && !MSWINCE || USE_PROC_FOR_LIBRARIES && THREADS] (GC_fault_handler): Likewise. * os_dep.c [!HAVE_GET_STACK_BASE && !NEED_FIND_LIMIT] (GC_get_stack_base): Likewise. * os_dep.c [MPROTECT_VDB && DARWIN] (catch_exception_raise_state, catch_exception_raise_state_identity, catch_exception_raise): Likewise. * pthread_stop_world.c [!NACL && !GC_OPENBSD_UTHREADS && !SUSPEND_HANDLER_NO_CONTEXT] (GC_suspend_sigaction): Likewise. * pthread_stop_world.c [!NACL && !GC_OPENBSD_UTHREADS] (GC_suspend_handler_inner): Likewise. * pthread_support.c (GC_do_blocking_inner): Likewise. * pthread_support.c [GC_ENABLE_SUSPEND_THREAD && SIGNAL_BASED_STOP_WORLD] (GC_suspend_self_blocked): Likewise. * tests/gctest.c [!DBG_HDRS_ALL] (fail_proc1): Likewise. * tests/gctest.c [(MSWIN32 && !__MINGW32__ || MSWINCE) && !NO_WINMAIN_ENTRY] (WinMain): Likewise. * tests/gctest.c [!PCR && !GC_WIN32_THREADS && !GC_PTHREADS && CPPCHECK && RTEMS] (Init): Likewise. * tests/gctest.c [GC_WIN32_THREADS && !GC_PTHREADS] (thr_run_one_test): Likewise. * tests/gctest.c [MSWINCE] (thr_window): Likewise. * tests/gctest.c [GC_PTHREADS] (thr_run_one_test): Likewise. * typd_mlc.c (GC_array_mark_proc): Likewise. * win32_threads.c (GC_register_altstack, GC_do_blocking_inner): Likewise. * win32_threads.c [!GC_PTHREADS && !GC_NO_THREADS_DISCOVERY] (GC_DllMain): Likewise. * cord/cordxtra.c (CORD_ATTR_UNUSED): Remove. * include/private/gc_priv.h [!GC_ATTR_UNUSED] (GC_ATTR_UNUSED): Likewise. * cord/cordxtra.c (CORD_nul_func): Cast unused argument to void instead of using CORD_ATTR_UNUSED. * cord/cordxtra.c [!GC_NO_FINALIZATION] (CORD_lf_close_proc): Likewise. * include/private/gc_priv.h [!UNUSED_ARG] (UNUSED_ARG): Define macro.
* Fix 'passing arg 1 of GC_apply_to_all_blocks from incompatible type' errorIvan Maidanski2022-08-051-2/+3
| | | | | | | | | | | | | | | | | | (fix of commit e717f1191) Issue #460 (bdwgc). * backgraph.c [MAKE_BACK_GRAPH] (per_object_helper): Add GC_CALLBACK modifier; change 2nd argument type from word to GC_word. * checksums.c [CHECKSUMS] (GC_add_block): Likewise. * dbg_mlc.c [!SHORT_DBG_HDRS] (GC_check_heap_block): Likewise. * mark.c (clear_marks_for_block): Likewise. * misc.c (block_add_size): Likewise. * reclaim.c (GC_reclaim_block, GC_print_block_descr, GC_do_enumerate_reachable_objects): Likewise. * checksums.c [CHECKSUMS] (GC_check_blocks): Remove unnecessary cast of zero to word. * include/gc/gc_mark.h (GC_apply_to_all_blocks): Add GC_ATTR_NONNULL(1).
* 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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 spaces around '=' in printed messagesIvan Maidanski2021-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (refactoring) * checksums.c (GC_check_blocks): Remove space before '=' and add a space (if missing) after '=' in printed message. * darwin_stop_world.c [DEBUG_THREADS_EXTRA] (GC_FindTopOfStack): Likewise. * dbg_mlc.c (GC_print_obj, GC_debug_print_heap_obj_proc): Likewise. * dyn_load.c [IRIX5 || USE_PROC_FOR_LIBRARIES && !LINUX || HPUX] (GC_register_dynamic_libraries): Likewise. [DEBUG_VIRTUALQUERY] (GC_dump_meminfo): Likewise. * os_dep.c [NEED_PROC_MAPS] (GC_get_maps): Likewise. * os_dep.c [PROC_VDB] (GC_proc_read_dirty): Likewise. * os_dep.c [SOFT_VDB] (soft_read_dirty): Likewise. * pthread_support.c (set_marker_thread_name, GC_start_mark_threads_inner): Likewise. * pthread_support.c [DEBUG_THREADS] (GC_delete_thread, GC_unregister_my_thread_inner, GC_unregister_my_thread, GC_thread_exit_proc, GC_start_rtn_prepare_thread): Likewise. * pthread_support.c [GC_LINUX_THREADS] (GC_get_nprocs): Likewise. * tests/disclaim_weakmap_test.c [DEBUG_DISCLAIM_WEAKMAP] (weakmap_add, weakmap_disclaim): Likewise. * tests/subthread_create.c (run_one_test): Likewise. * win32_threads.c (GC_delete_thread, GC_push_stack_for, GC_get_next_stack): Likewise. * darwin_stop_world.c [DEBUG_THREADS] (GC_stack_range_for): Remove '=' in printed message and/or improve message. * mark.c (GC_signal_mark_stack_overflow): Likewise. * mark_rts.c [!NO_DEBUGGING] (GC_print_static_roots): Likewise. * pthread_stop_world.c [DEBUG_THREADS] (GC_push_all_stacks, GC_suspend_all): Likewise. * pthread_support.c (GC_thr_init): Likewise. * tests/disclaim_test.c (pair_dct, pair_new): Likewise. * tests/disclaim_weakmap_test.c (pair_check_rec): Likewise. * tests/initsecondarythread.c (main): Likewise. * tests/subthread_create.c (entry, main): Likewise. * tests/test.c [THREADS] (fork_a_thread, main): Likewise. * tests/test.c [MSWINCE] (thr_window): Likewise. * tests/test.c [NTHREADS>0] (main): Likewise. * tests/threadkey_test.c (main): Likewise. * dyn_load.c [ALPHA && OSF1 && DL_VERBOSE] (GC_register_dynamic_libraries): Reformat printed messages. * tests/disclaim_test.c (main): Remove space after '#' in printed message.
* Remove stubborn objects allocation code completelyIvan Maidanski2018-05-151-42/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (code refactoring) * README.md (Incremental/Generational Collection): Remove information about stubborn objects; add information about GC_end_stubborn_change usage. * alloc.c [STUBBORN_ALLOC] (GC_finish_collection): Do not call GC_clean_changing_list. * checksums.c (NSUMS, GC_check_dirty): Remove comment related to stubborn objects. * checksums.c [STUBBORN_ALLOC] (GC_on_free_list): Remove. * doc/README.macros (STUBBORN_ALLOC): Likewise. * include/private/gc_priv.h [STUBBORN_ALLOC] (GC_sobjfreelist, GC_arrays._sobjfreelist, GC_changed_pages, GC_arrays._changed_pages, GC_prev_changed_pages, GC_arrays._prev_changed_pages): Likewise. * include/private/gc_priv.h (GC_read_changed, GC_page_was_changed, GC_clean_changing_list, GC_stubborn_init): Likewise. * tests/test.c (stubborn_count): Likewise. * checksums.c (GC_n_changed_errors): Likewise. * checksums.c [STUBBORN_ALLOC] (GC_update_check_page, GC_check_dirty): Do not update GC_n_changed_errors value. * checksums.c (GC_check_dirty): Do not check/print GC_n_changed_errors value. * configure.ac (checksums): Update help message (remove information about stubborn objects). * dbg_mlc.c (GC_print_obj, GC_debug_end_stubborn_change, GC_debug_realloc, GC_debug_generic_or_special_malloc): Do not handle STUBBORN object kind specially. * mallocx.c (GC_generic_or_special_malloc, GC_realloc): Likewise. * mark.c [!GC_DISABLE_INCREMENTAL] (GC_push_next_marked_dirty): Likewise. * dbg_mlc.c [STUBBORN_ALLOC] (GC_debug_malloc_stubborn): Redirect to GC_debug_malloc; remove GC_ATTR_MALLOC. * dbg_mlc.c [STUBBORN_ALLOC] (GC_debug_change_stubborn): Change to no-op. * doc/README.amiga (WHATS NEW): Do not reference GC_malloc_stubborn. * doc/README.macros (CHECKSUMS): Update (remove information about stubborn objects). * doc/gcdescr.md (Allocation, Generational Collection and Dirty Bits): Likewise. * doc/gcinterface.md (C/C++ Interface): Likewise. * doc/leak.md (Using the Garbage Collector as Leak Detector): Likewise. * doc/gcdescr.md (Generational Collection and Dirty Bits): Add information about MANUAL_VDB. * include/gc.h (GC_malloc, GC_free, GC_realloc): Update comment (remove information about stubborn objects). * malloc.c (GC_generic_malloc_inner): Likewise. * tests/test.c (reverse_test_inner): Likewise. * include/gc.h (GC_malloc_stubborn, GC_debug_malloc_stubborn): Add GC_ATTR_DEPRECATED; remove GC_ATTR_MALLOC and GC_ATTR_ALLOC_SIZE. * include/gc.h (GC_MALLOC_STUBBORN, GC_NEW_STUBBORN): Redirect to normal GC_MALLOC/NEW; add comment that stubborn objects allocation is deprecated. * include/gc.h [GC_DEBUG] (GC_CHANGE_STUBBORN): Redirect to GC_change_stubborn (not GC_debug_change_stubborn). * include/gc.h (GC_change_stubborn): Add GC_ATTR_DEPRECATED. * include/gc.h [!CPPCHECK] (GC_debug_change_stubborn): Likewise. * include/gc.h (GC_change_stubborn, GC_debug_change_stubborn): Remove GC_ATTR_NONNULL. * include/gc.h (GC_end_stubborn_change): Add comment related to usage when the library is built with MANUAL_VDB defined. * include/gc.h [_AMIGA && !GC_AMIGA_MAKINGLIB] (GC_malloc_stubborn): Remove macro. * include/private/gc_priv.h (STUBBORN_ALLOC): Remove comment. * include/private/gc_priv.h (STUBBORN): Replace with GC_N_KINDS_INITIAL_VALUE definition. * mark.c (GC_obj_kinds): Remove initialization for STUBBORN_ALLOC element. * mark.c (GC_N_KINDS_INITIAL_VALUE): Move to gc_priv.h. * mark.c (GC_n_rescuing_pages): Define only if GC_DISABLE_INCREMENTAL. * mark.c [STUBBORN_ALLOC] (GC_initiate_gc): Do not call GC_read_changed. * misc.c [STUBBORN_ALLOC] (GC_init): Do not call GC_stubborn_init. * stubborn.c (GC_malloc_stubborn): Remove GC_ATTR_MALLOC. * tests/test.c [!VERY_SMALL_CONFIG] (cons): Replace GC_MALLOC_STUBBORN with GC_MALLOC call; update collectable_count instead of stubborn_count. * tests/test.c (check_heap_stats): Do not print stubborn_count value.
* Change type of hb_sz field (of hblkhdr) from size_t to wordIvan Maidanski2018-02-081-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed to make the size of hb_sz to be the same as of AO_t. * allchblk.c [USE_MUNMAP] (GC_unmap_old): Cast hhdr->hb_sz to size_t when passed to GC_unmap(). * allchblk.c (GC_allochblk_nth): Cast hhdr->hb_sz to signed_word when assigned to size_avail. * allchblk.c [USE_MUNMAP] (GC_allochblk_nth): Cast hhdr->hb_sz to size_t when passed to GC_remap(). * alloc.c (GC_set_fl_marks, GC_clear_fl_marks): Change type of sz and bit_no local variables from size_t/unsigned to word. * dbg_mlc.c (GC_check_heap_block): Likewise. * backgraph.c [MAKE_BACK_GRAPH] (per_object_helper): Cast hhdr->hb_sz to size_t; change type of i local variables from int to size_t. * checksums.c [CHECKSUMS] (GC_on_free_list): Change type of sz local variable from size_t to word. * mark.c (GC_push_marked, GC_push_unconditionally, GC_block_was_dirty): Likewise. * reclaim.c (GC_reclaim_small_nonempty_block, GC_disclaim_and_reclaim_or_free_small_block, GC_reclaim_block, GC_n_set_marks): Likewise. * checksums.c [CHECKSUMS] (GC_add_block): Remove bytes local variable (to avoid casting of hhdr->hb_sz). * dbg_mlc.c (GC_debug_free): Change type of i and obj_sz local variables from size_t to word. * dbg_mlc.c (GC_check_leaked): Likewise. * extra/pcr_interface.c (GC_enumerate_block): Change type of sz local variable from int to size_t. * extra/pcr_interface.c (GC_enumerate_block): Cast hhdr->hb_sz to size_t when assigned to sz. * mallocx.c (GC_realloc): Likewise. * mark.c (GC_set_hdr_marks): Likewise. * reclaim.c (GC_do_enumerate_reachable_objects): Likewise. * include/private/gc_pmark.h [MARK_BIT_PER_OBJ] (PUSH_CONTENTS_HDR): Cast hhdr->hb_sz to size_t in assignment of obj_displ. * include/private/gc_priv.h (struct hblkhdr): Change type of hb_sz from size_t to word. * include/private/gc_priv.h (MARK_BIT_NO): Cast offset argument to word instead of unsigned. * malloc.c (GC_free): Cast hhdr->hb_sz to size_t. * mallocx.c (GC_get_kind_and_size): Likewise. * mark.c (GC_clear_hdr_marks): Likewise. * misc.c (GC_size): Likewise. * misc.c (GC_do_blocking): Remove redundant cast of hhdr->hb_sz. * reclaim.c (GC_reclaim_clear, GC_reclaim_uninit, GC_disclaim_and_reclaim, GC_continue_reclaim): Change type of sz argument from size_t to word. * typd_mlc.c (GC_array_mark_proc): Change type of sz and nwords local variables from size_t to word.
* Remove unnecessary type casts of printf arguments to unsigned longIvan Maidanski2017-08-301-5/+4
| | | | | | | | | | | | | (code refactoring) * alloc.c [!NO_DEBUGGING] (GC_print_heap_sects): Remove unnecessary cast to unsigned long in GC_*_printf call and adjust printf format specifier to match the argument type. * checksums.c [CHECKSUMS] (GC_checksum): Likewise. * mark.c [PARALLEL_MARK] (GC_mark_local): Likewise. * tests/test.c (typed_test): Likewise. * checksums.c [CHECKSUMS] (GC_checksum): Change type of GC_n_clean, GC_n_dirty from int to unsigned long.
* Eliminate 'GC_record_fault is never used' cppcheck style warningIvan Maidanski2016-11-141-3/+5
| | | | | | | * checksums.c [CHECKSUMS] (GC_record_fault): Do not define unless MPROTECT_VDB and not DARWIN. * os_dep.c [MPROTECT_VDB && CHECKSUMS] (GC_record_fault): Do not declare if DARWIN.
* Fix page calculation in checksumsIvan Maidanski2016-09-231-2/+3
| | | | | | | | | | | While consistent use of rounding mode for computing GC_faulted entries is ok, the proper way of getting page number of an address is just to clear the lowest bits of the latter. * checksums.c (GC_record_fault, GC_was_faulted): Do not round-up when computing page. * checksums.c (GC_record_fault): Add assertion that GC_page_size is initialized.
* Revert "Refactoring of GC_Xobjfreelist" partiallyIvan Maidanski2016-06-301-1/+1
| | | | | | This reverts commit 41871b970c8fd9704835c1a221a8f9f1deea707a partially (GC_malloc_kind_global, GC_generic_malloc_uncollectable, GC_destroy_thread_local are not reverted).
* Refactoring of GC_XobjfreelistAlessandro Bruni2016-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (use single array to keep free lists of all kinds) * alloc.c: Update comment (replace GC_objfreelist with GC_freelists[NORMAL]). * checksums.c (GC_on_free_list): Replace GC_sobjfreelist with GC_freelists[STUBBORN]. * mark.c (GC_obj_kinds): Likewise. * include/private/gc_priv.h (PTRFREE, NORMAL, UNCOLLECTABLE, AUNCOLLECTABLE, STUBBORN, IS_UNCOLLECTABLE): Move definition upper to be before _GC_arrays declaration. * include/private/gc_priv.h (PREDEFINED_KINDS): New macro. * include/private/gc_priv.h (GC_freelists): New macro (of global variable if SEPARATE_GLOBALS). * include/private/gc_priv.h (_GC_arrays): Replace _objfreelist, _aobjfreelist, _uobjfreelist, _auobjfreelist, _sobjfreelist fields with single _freelists[] field. * include/private/gc_priv.h (GC_objfreelist, GC_aobjfreelist, GC_auobjfreelist, GC_sobjfreelist, GC_uobjfreelist, beginGC_objfreelist, endGC_objfreelist, beginGC_aobjfreelist, endGC_aobjfreelist): Remove macro. * include/private/gc_priv.h (GC_objfreelist, GC_aobjfreelist): Replace variable declarations with single GC_freelists[] one (if SEPARATE_GLOBALS). * malloc.c (GC_malloc_atomic): Replace GC_aobjfreelist with GC_freelists[PTRFREE]. * mallocx.c (GC_aobjfreelist_ptr): Likewise. * mark.c (GC_obj_kinds): Likewise. * thread_local_alloc.c (GC_destroy_thread_local): Likewise. * malloc.c (GC_malloc): Replace GC_objfreelist with GC_freelists[NORMAL]. * mallocx.c (GC_objfreelist_ptr): Likewise. * mark.c (GC_obj_kinds): Likewise. * thread_local_alloc.c (GC_destroy_thread_local): Likewise. * malloc.c (GC_malloc_uncollectable): Replace GC_uobjfreelist with GC_freelists[UNCOLLECTABLE]. * mallocx.c (GC_uobjfreelist_ptr): Likewise. * mark.c (GC_obj_kinds): Likewise. * mallocx.c (GC_auobjfreelist_ptr, GC_malloc_atomic_uncollectable): Replace GC_auobjfreelist with GC_freelists[AUNCOLLECTABLE]. * mark.c (GC_obj_kinds): Likewise. * misc.c (GC_init): Exclude whole GC_freelists from scanning instead of beginGC_objfreelist and beginGC_aobjfreelist (if SEPARATE_GLOBALS).
* Define ROUNDUP_PAGESIZE, ROUNDUP_GRANULE_SIZE macros (code refactoring)Ivan Maidanski2014-03-301-6/+2
| | | | | | | | | | | | | | | * alloc.c (GC_expand_hp_inner): Use ROUNDUP_PAGESIZE(). * checksums.c (GC_record_fault, GC_was_faulted): Likewise. * os_dep.c (GC_unix_mmap_get_mem, GC_wince_get_mem, GC_unmap_start, GC_remove_protection): Likewise. * headers.c (GC_scratch_alloc): Use ROUNDUP_GRANULE_SIZE(). * malloc.c (GC_alloc_large): Likewise. * mallocx.c (GC_malloc_many): Likewise. * headers.c (GC_scratch_alloc): Use ROUNDUP_PAGESIZE() (only if USE_MMAP). * include/private/gc_priv.h (ROUNDUP_GRANULE_SIZE, ROUNDUP_PAGESIZE): Define macro to round up a value to a multiple of a granule or a page, respectively.
* Replace conditional GC_log_printf calls with GC_COND/VERBOSE_LOG_PRINTFIvan Maidanski2012-11-121-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (code refactoring) * allchblk.c (GC_freehblk): Replace "if (GC_print_stats) GC_log_printf" with GC_COND_LOG_PRINTF. * alloc.c (GC_timeout_stop_func, GC_maybe_gc, GC_try_to_collect_inner, GC_stopped_mark, GC_finish_collection, GC_expand_hp_inner, GC_collect_or_expand): Likewise. * backgraph.c (backwards_height, GC_print_back_graph_stats): Likewise. * checksums.c (GC_check_blocks, GC_check_dirty): Likewise. * dyn_load.c (GC_register_dynamic_libraries): Likewise. * finalize.c (GC_general_register_disappearing_link, GC_register_finalizer_inner): Likewise. * gcj_mlc.c (GC_init_gcj_malloc): Likewise. * headers.c (GC_scratch_alloc): Likewise. * mark.c (GC_mark_some_inner, GC_mark_some, GC_signal_mark_stack_overflow, GC_return_mark_stack, alloc_mark_stack): Likewise. * obj_map.c (GC_add_map_entry): Likewise. * os_dep.c (GC_get_maps, backing_store_base_from_proc, GC_register_data_segments, detect_GetWriteWatch, GC_add_current_malloc_heap, GC_remap, PROTECT, GC_write_fault_handler, GC_dirty_init, GC_mprotect_thread): Likewise. * pthread_stop_world.c (GC_stop_world, GC_start_world, GC_stop_init): Likewise. * pthread_support.c (start_mark_threads, GC_thr_init): Likewise. * win32_threads.c (GC_register_my_thread_inner, GC_thr_init): Likewise. * alloc.c (GC_finish_collection): Replace "if (GC_print_stats == VERBOSE) GC_log_printf" with GC_VERBOSE_LOG_PRINTF. * blacklst.c (GC_promote_black_lists): Likewise. * darwin_stop_world.c (GC_push_all_stacks): Likewise. * mark.c (GC_mark_local, GC_do_parallel_mark): Likewise. * os_dep.c (GC_dirty_init): Likewise. * pthread_stop_world.c (GC_push_all_stacks): Likewise. * win32_threads.c (GC_push_all_stacks): Likewise. * include/private/gc_priv.h (GC_COND_LOG_PRINTF, GC_VERBOSE_LOG_PRINTF): New macro (check GC_print_stats and call GC_log_printf if enabled). * os_dep.c (GC_dirty_init, GC_read_dirty): Replace "if (GC_print_stats) GC_err_printf" with WARN.
* Replace pointer relational comparisons with non-pointer onesIvan Maidanski2012-03-051-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Resolve minor warnings (reported by GCC with '-pedantic') in checksumsIvan Maidanski2011-11-111-1/+1
| | | | | * checksums.c (GC_update_check_page): Explicitly cast a pointer argument of GC_printf to void* to match %p format specifier.
* Replace ARGSUSED comment-based annotation with GCC 'unused' attribute.Ivan Maidanski2011-09-141-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turn on unused-parameter checking for GCC. * alloc.c (GC_try_to_collect_general): Add GC_ATTR_UNUSED attribute to an argument. * tests/test.c (tiny_reverse_test, thr_run_one_test): Likewise. * backgraph.c (reset_back_edge, update_max_height): Replace ARGSUSED annotation with GC_ATTR_UNUSED attribute for some arguments. * checksums.c (GC_add_block): Likewise. * dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change, GC_check_heap_block): Likewise. * finalize.c (GC_null_finalize_mark_proc): Likewise. * gcj_mlc.c (GC_gcj_fake_mark_proc): Likewise. * mark.c (GC_noop, clear_marks_for_block, GC_mark_and_push): Likewise. * mark_rts.c (GC_push_conditional_with_exclusions, GC_push_current_stack): Likewise. * misc.c (GC_default_oom_fn, GC_do_blocking_inner): Likewise. * os_dep.c (GC_fault_handler_openbsd, GC_fault_handler, GC_remove_protection, GC_page_was_dirty, GC_page_was_ever_dirty): Likewise. * pthread_stop_world.c (GC_suspend_handler, GC_suspend_handler_inner): Likewise. * pthread_support.c (GC_do_blocking_inner): Likewise. * stubborn.c (GC_change_stubborn, GC_end_stubborn_change): Likewise. * tests/test.c (fail_proc1): Likewise. * typd_mlc.c (GC_array_mark_proc): Likewise. * win32_threads.c (GC_do_blocking_inner, DllMain): Likewise. * include/private/gc_priv.h (GC_ATTR_UNUSED): Define new macro. * cordxtra.c (CORD_ATTR_UNUSED): Likewise. * cordxtra.c (CORD_nul_func, CORD_lf_close_proc): Replace ARGSUSED annotation with CORD_ATTR_UNUSED attribute for an argument. * mach_dep.c (GC_clear_stack_inner): Remove ARGSUSED annotation and use "limit" argument in the function (to suppress compiler warning). * misc.c (GC_clear_stack_inner): Remove ARGSUSED. * tests/threadkey_test.c (on_thread_exit_inner, on_thread_exit): Use all function arguments (to suppress compiler warning). * configure.ac (CFLAGS): Remove "-Wno-unused-parameter" option.
* 2011-05-31 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alloc.c (GC_add_current_malloc_heap, GC_build_back_graph, GC_traverse_back_graph): Move prototype to gc_priv.h. * checksums.c (GC_page_was_ever_dirty): Ditto. * dbg_mlc.c (GC_default_print_heap_obj_proc): Ditto. * dyn_load.c (GC_parse_map_entry, GC_get_maps, GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base, GC_get_next_stack): Ditto. * finalize.c (GC_reset_finalizer_nested, GC_check_finalizer_nested): Ditto. * gcj_mlc.c (GC_start_debugging, GC_store_debug_info): Ditto. * malloc.c (GC_extend_size_map, GC_text_mapping): Ditto. * mark_rts.c (GC_mark_thread_local_free_lists): Ditto. * misc.c (GC_register_main_static_data, GC_init_win32, GC_setpagesize, GC_init_linux_data_start, GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf, GC_initialize_offsets, GC_bl_init, GC_do_blocking_inner, GC_bl_init_no_interiors): Ditto. * os_dep.c (GC_greatest_stack_base_below, GC_push_all_stacks): Ditto. * reclaim.c (GC_check_leaked): Ditto. * win32_threads.c (GC_gww_dirty_init): Ditto. * darwin_stop_world.c (GC_is_mach_marker, GC_mprotect_stop, GC_mprotect_resume): Move prototype to darwin_stop_world.h. * pthread_support.c (GC_FindTopOfStack): Ditto. * dyn_load.c (GC_cond_add_roots): Merge adjacent definitions. * mark.c (GC_page_was_ever_dirty): Remove (as already declared). * mark_rts.c (GC_roots_present): Change return type to void pointer (to match the prototype); return NULL instead of FALSE. * mark_rts.c (GC_add_roots_inner): Cast GC_roots_present() result. * os_dep.c (NEED_PROC_MAPS): Move definition to gcconfig.h. * os_dep.c (GC_write_fault_handler): Make STATIC. * os_dep.c (GC_set_write_fault_handler): New function (only if GC_WIN32_THREADS). * pthread_start.c (GC_start_rtn_prepare_thread, GC_thread_exit_proc): Move prototype to pthread_support.h. * pthread_support.c (GC_nacl_initialize_gc_thread, GC_nacl_shutdown_gc_thread, GC_unblock_gc_signals): Ditto. * pthread_support.c (GC_stop_init): Move prototype to pthread_stop_world.h. * thread_local_alloc.c (GC_check_tls_for): Reformat comment. * win32_threads.c (GC_write_fault_handler): Remove prototype. * win32_threads.c (GC_register_my_thread_inner): Call GC_set_write_fault_handler instead of SetUnhandledExceptionFilter (only if MPROTECT_VDB). * doc/README.win32: Add information about DMC. * include/private/gc_priv.h (GC_set_write_fault_handler): New prototype (only if GC_WIN32_THREADS and MPROTECT_VDB).
* 2011-05-18 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-12/+14
| | | | | | | * checksums.c (GC_check_blocks, GC_check_dirty): Do log printing only if GC_print_stats; print errors using GC_err_printf. * checksums.c (GC_check_blocks): Join adjacent printf() calls into a single one.
* 2011-04-03 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * allchblk.c (GC_freehblk): Use GC_log_printf instead of GC_printf inside "if (GC_print_stats)" branch. * alloc.c (GC_collect_or_expand): Ditto. * dyn_load.c (GC_register_dynamic_libraries): Ditto. * headers.c (GC_scratch_alloc): Ditto. * os_dep.c (GC_get_maps, GC_remap, PROTECT, GC_write_fault_handler, GC_dirty_init, GC_mprotect_thread): Ditto. * alloc.c (min_bytes_allocd): Use GC_log_printf instead of GC_printf for DEBUG_THREADS output. * darwin_stop_world.c (GC_stack_range_for, GC_suspend_thread_list, GC_stop_world, GC_thread_resume, GC_start_world): Ditto. * pthread_start.c (GC_inner_start_routine): Ditto. * pthread_stop_world.c (GC_suspend_handler, GC_restart_handler, GC_push_all_stacks, GC_suspend_all, GC_stop_world, GC_start_world): Ditto. * pthread_support.c (GC_mark_thread, GC_get_nprocs, GC_start_rtn_prepare_thread, pthread_create): Ditto. * alloc.c (GC_adj_bytes_allocd, GC_maybe_gc, GC_stopped_mark, GC_finish_collection): Reformat code. * pthread_stop_world.c (GC_print_sig_mask): Ditto. * pthread_support.c (GC_thr_init): Ditto. * checksums.c (GC_update_check_page): Use GC_printf() instead of GC_err_printf() for error printing. * checksums.c (GC_check_blocks, GC_check_dirty): Use GC_log_printf instead of GC_printf for logging purposes. * dyn_load.c (sys_errlist, sys_nerr, errno): Move declaration of external variable outside from GC_register_dynamic_libraries. * dyn_load.c (GC_register_dynamic_libraries): Don't use sys_errlist value if errno equals to sys_nerr. * dyn_load.c (GC_register_dynamic_libraries): Use GC_log_printf instead of GC_printf for DL_VERBOSE output. * dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove, GC_init_dyld): Use GC_log_printf instead of GC_printf for DARWIN_DEBUG output. * os_dep.c (catch_exception_raise): Use GC_log_printf instead of GC_printf for DEBUG_EXCEPTION_HANDLING output. * reclaim.c (GC_print_free_list): Move "n" increment out of GC_printf() call.
* 2011-04-02 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * allchblk.c (GC_print_hblkfreelist): Adjust (make uniform across BDWGC) printed message (adjust letters case, terminating dot and new line symbols). * alloc.c (GC_check_fl_marks): Ditto. * backgraph.c (new_back_edges): Ditto. * checksums.c (GC_check_dirty): Ditto. * darwin_stop_world.c (GC_push_all_stacks, GC_suspend_thread_list): Ditto. * dbg_mlc.c (GC_print_type, GC_debug_free, GC_debug_realloc, store_old): Ditto. * dyn_load.c (GC_register_dynamic_libraries): Ditto. * mark.c (GC_initiate_gc, GC_mark_some, GC_mark_from, GC_push_all, GC_push_selected, GC_push_next_marked_dirty): Ditto. * mark_rts.c (GC_exclude_static_roots_inner): Ditto. * os_dep.c (GC_remap, GC_default_push_other_roots, GC_push_thread_structures, GC_dirty_init, GC_read_dirty, catch_exception_raise_state, catch_exception_raise_state_identity, GC_mprotect_thread_notify, GC_mprotect_thread, catch_exception_raise): Ditto. * pthread_stop_world.c (GC_print_sig_mask, GC_push_all_stacks, GC_stop_world, GC_stop_init): Ditto. * pthread_support.c (GC_thr_init, GC_register_my_thread_inner, GC_start_routine): Ditto. * win32_threads.c (GC_register_my_thread_inner, GC_push_all_stacks, GC_win32_start_inner, GC_pthread_join, GC_pthread_start_inner): Ditto. * alloc.c (GC_expand_hp_inner): Realign the code. * mark.c (GC_mark_from, GC_mark_local, GC_do_parallel_mark): Ditto. * misc.c (GC_init): Ditto. * os_dep.c (GC_dirty_init, GC_read_dirty): Ditto. * include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Ditto. * tests/test.c (run_one_test): Ditto. * misc.c (GC_err_puts): Document. * misc.c (GC_err_write): Remove. * os_dep.c (dump_maps): Ditto. * include/private/gc_priv.h (GC_err_write): Ditto. * os_dep.c (GC_print_address_map): Call GC_err_puts() instead of dump_maps() and GC_err_write(). * os_dep.c (GC_read_dirty): Remove redundant brackets.
* 2009-12-08 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | * allchblk.c (GC_allochblk_nth): Don't call GC_remove_protection() if GC_DISABLE_INCREMENTAL. * reclaim.c (GC_reclaim_generic): Ditto. * checksums.c (GC_page_was_ever_dirty): Add prototype. * include/private/gc_locks.h (GC_mark_lock_holder): Don't declare unless PARALLEL_MARK. * include/private/gc_priv.h (GC_dirty_maintained, GC_page_was_dirty, GC_remove_protection, GC_dirty_init): Don't declare if GC_DISABLE_INCREMENTAL. * include/private/gc_priv.h (GC_print_finalization_stats): Don't declare if SMALL_CONFIG. * include/private/gcconfig.h (CHECKSUMS): Explicitly undefine if GC_DISABLE_INCREMENTAL (since nothing to check). * include/private/gcconfig.h (DEFAULT_VDB): Don't define if GC_DISABLE_INCREMENTAL. * os_dep.c (GC_dirty_maintained): Ditto. * mark.c (GC_initiate_gc): Don't call GC_read_dirty() if GC_DISABLE_INCREMENTAL. * os_dep.c (GC_gww_page_was_ever_dirty, GC_page_was_ever_dirty): Uncomment; define only if CHECKSUMS.
* 2009-10-21 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-10-18 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-9/+3
| | | | | | | | | | | | | | | | * backgraph.c (GC_quiet): Remove the declaration (not needed anymore since gc_priv.h is always included). * checksums.c (GC_quiet): Ditto. * gcj_mlc.c (GC_quiet): Ditto. * headers.c (GC_hdr_cache_hits, GC_hdr_cache_misses): Add the comment. * include/private/gc_hdrs.h (GC_hdr_cache_hits, GC_hdr_cache_misses): Ditto. * mark.c (GC_first_nonempty): Make the volatile variable STATIC. * pthread_stop_world.c (GC_stop_count, GC_world_is_stopped): Ditto. * win32_threads.c (GC_please_stop, GC_max_thread_index, GC_mark_mutex_waitcnt): Ditto.
* 2009-09-30 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * allchblk.c (GC_large_alloc_warn_interval): Move declaration from gc_priv.h. * allchblk.c (GC_large_alloc_warn_suppressed): Move definition from misc.c; define as STATIC. * include/private/gc_priv.h (GC_large_alloc_warn_interval, GC_large_alloc_warn_suppressed): Remove declaration. * alloc.c (GC_bytes_found): Add "defined in" comment. * mallocx.c (GC_bytes_found): Ditto. * misc.c (GC_unmap_threshold): Ditto. * os_dep.c (GC_old_allocator): Ditto. * pthread_support.c (GC_markers): Ditto. * thread_local_alloc.c (GC_gcjobjfreelist, GC_gcj_malloc_initialized, GC_gcj_kind): Ditto. * win32_threads.c (GC_markers): Ditto. * alloc.c (GC_start_time): Explicitly initialize to 0 or NULL (to be distinctive from a variable declaration). * backgraph.c (GC_max_height, GC_deepest_obj): Ditto. * blacklst.c (GC_old_normal_bl, GC_incomplete_normal_bl, GC_old_stack_bl, GC_incomplete_stack_bl): Ditto. * checksums.c (GC_faulted, GC_n_dirty_errors, GC_n_faulted_dirty_errors, GC_n_changed_errors, GC_n_clean, GC_n_dirty, GC_bytes_in_used_blocks): Ditto. * dbg_mlc.c (GC_smashed): Ditto. * finalize.c (GC_old_dl_entries): Ditto. * gcj_mlc.c (GC_gcj_kind, GC_gcj_debug_kind, GC_gcjobjfreelist, GC_gcjdebugobjfreelist): Ditto. * mach_dep.c (GC_save_regs_ret_val): Ditto. * mark.c (GC_n_rescuing_pages, GC_mark_stack, GC_mark_stack_limit, GC_mark_stack_top): Ditto. * misc.c (GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset): Ditto. * os_dep.c (GC_data_start, GC_page_size, GC_sysinfo, GC_old_segv_handler, GC_old_bus_handler, GC_old_bus_handler_used_si, GC_old_segv_handler_used_si, GC_proc_buf, GC_proc_fd, GC_vd_base): Ditto. * pthread_stop_world.c (GC_stop_count, GC_stopping_pid): Ditto. * reclaim.c (GC_leaked): Ditto. * typd_mlc.c (GC_explicit_kind, GC_array_kind, GC_ext_descriptors, GC_typed_mark_proc_index, GC_array_mark_proc_index, GC_eobjfreelist, GC_arobjfreelist): Ditto. * win32_threads.c (GC_pthread_map_cache, GC_marker_cv, GC_marker_Id): Ditto. * dbg_mlc.c (GC_smashed, GC_n_smashed): Define as STATIC. * gcj_mlc.c (GC_gcjdebugobjfreelist): Ditto. * os_dep.c (GC_vd_base): Ditto. * pthread_support.c (GC_mark_threads): Ditto. * reclaim.c (GC_leaked): Ditto. * typd_mlc.c (GC_bm_table): Ditto. * mark_rts.c (GC_save_regs_ret_val): Change declaration type to that of definition; add "defined in" comment. * mark_rts.c (GC_push_current_stack): Remove unnecessary cast for GC_save_regs_ret_val. * misc.c (GC_check_heap, GC_print_all_smashed, GC_start_call_back): Remove unnecessary cast (of 0). * misc.c (GC_LARGE_ALLOC_WARN_INTERVAL): New tuning macro. * misc.c (GC_large_alloc_warn_interval): Initialize to GC_LARGE_ALLOC_WARN_INTERVAL value. * misc.c (GC_tmp): Change to "static". * os_dep.c (GC_setpagesize): Reformat the code (collapse multiple function definitions). * os_dep.c (GC_mprotect_state): Define as static. * pthread_support.c (dummy_thread_local): Prefix with "GC_". * win32_threads.c (WinMain): Remove FIXME for WinCE.
* 2009-09-25 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-4/+4
| | | | | | | | | | | | | | | | | | | | | * checksums.c (GC_checksum, GC_update_check_page): Remove "register" keyword in local variable declarations (for the code used only for debugging or which is not time-critical). * dbg_mlc.c (GC_has_other_debug_info, GC_store_debug_info, GC_store_debug_info_inner, GC_check_annotated_obj, GC_print_obj, GC_print_smashed_obj, GC_debug_end_stubborn_change, GC_debug_invoke_finalizer): Ditto. * dyn_load.c (GC_register_dynamic_libraries): Ditto. * mallocx.c (GC_realloc): Ditto. * mark_rts.c (GC_print_static_roots, GC_is_static_root, GC_clear_roots): Ditto. * misc.c (GC_write): Ditto. * os_dep.c (GC_print_callers): Ditto. * dyn_load.c (GC_register_dynamic_libraries): Rename "i" local variable to "j" for the nested loop (just not to hide the similar variable in the outer one). * mark_rts.c (GC_print_static_roots): Output an error message using GC_err_printf() (instead of GC_printf()).
* 2009-09-16 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-60/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2009-09-10 Ivan Maidanski <ivmai@mail.ru> ivmai2011-07-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (diff103_cvs) * alloc.c (GC_stopped_mark): Remove GC_log_printf("") (not needed anymore and GCC produces a warning for it). * alloc.c (GC_stopped_mark): Adjust printf argument type specifier. * backgraph.c: Include dbg_mlc.h before ifdef MAKE_BACK_GRAPH (for the case when the configuration information comes from aconfig file). * checksums.c: Ditto (for gc_priv.h and CHECKSUMS, respectively). * include/gc_allocator.h (GC_ATTR_UNUSED): Use "__unused__" keyword instead of "unused". * include/gc_allocator.h: Fix typos in comments. * thread_local_alloc.c: Ditto. * include/javaxfc.h (GC_finalize_all): Update comment. * include/private/gc_priv.h (GC_API_PRIV): New macro (defined as GC_API and serves only as a marker for the private but exported symbols used by test.c only). * include/private/gc_priv.h (GC_abort, GC_arrays, GC_is_marked, GC_printf, GC_err_printf, GC_log_printf): Replace GC_API decl with GC_API_PRIV one. * include/private/gc_priv.h (GC_fo_entries): Don't export it outside a DLL. * include/private/gc_priv.h (GC_ATTR_FORMAT_PRINTF): New macro designated to check the arguments correctness of printf-like functions (currently works only for GCC v3+). * include/private/gc_priv.h (GC_printf, GC_err_printf, GC_log_printf): Use GC_ATTR_FORMAT_PRINTF attribute.
* 2009-06-20 Hans Boehm <Hans.Boehm@hp.com>hboehm2011-07-261-6/+41
| | | | | | | | | | * allchblk.c (GC_allochblk_nth): Add assertion. * checksums.c: Add GC_record_fault, GC_was_faulted, CC_n_faulted_dirty_errors. (GC_check_dirty): Remove register declarations, print dirty bit errors on faulted pages. * os_dep.c (GC_write_fault_handler): Call GC_record_fault(). * os_dep.c (GC_remove_protection): Compute index correctly.
* 2008-11-07 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)hboehm2011-07-261-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (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-07-25 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)hboehm2011-07-261-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* gc7.0alpha1 tarball importgc7_0alpha1Ivan Maidanski2011-07-261-25/+22
|
* gc6.3 tarball importgc6_3Ivan Maidanski2011-07-261-18/+16
|
* gc6.0 tarball importgc6_0Ivan Maidanski2011-07-261-1/+1
|
* gc4.13 tarball importgc4_13Ivan Maidanski2011-07-261-2/+2
|
* gc4.8 tarball importgc4_8Ivan Maidanski2011-07-261-5/+55
|
* gc4.1 tarball importgc4_1Ivan Maidanski2011-07-261-0/+151