summaryrefslogtreecommitdiff
path: root/allchblk.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix visibility of some GC internal symbols used by GCJIvan Maidanski2012-03-251-4/+11
| | | | | | | | | | | | | | (Includes reverting part of commits 68b9f27, 91d5df5, b2345fb) * allchblk.c (GC_hblkfreelist, GC_free_bytes): Do not define array as STATIC again but only if GC_GCJ_SUPPORT (for GNU GCJ client). * blacklst.c (GC_is_black_listed): Do not define as GC_INNER again (for GNU GCJ client). * include/private/gc_priv.h (GC_is_black_listed): Likewise. * include/private/gc_priv.h (GC_hblkfreelist): Restore removed declaration (but only if GC_GCJ_SUPPORT). * reclaim.c (GC_n_set_marks): Do not define as STATIC again (for GCJ); update the comment.
* Replace pointer relational comparisons with non-pointer onesIvan Maidanski2012-03-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Improve GC_allochblk algorithm of block splitting when unmapping enabledIvan Maidanski2012-02-141-15/+20
| | | | | | | | | | | | | | | | | | (allow splitting up to limit based on per-list free space amount but skipping unmapped blocks) * allchblk.c (GC_allochblk_nth): Change type of "may_split" argument from GC_bool to int (to hold 3rd value). * allchblk.c (AVOID_SPLIT_REMAPPED): New macro (used as a value for "may_split"). * allchblk.c (GC_allochblk): Add "may_split" local variable (set to TRUE by default and passed to GC_allochblk_nth); do not zero split_limit in case of USE_MUNMAP (and remove FIXME); set may_split to AVOID_SPLIT_REMAPPED in case of USE_MUNMAP and split_limit is a non-zero value computed by GC_enough_large_bytes_left. * allchblk.c (GC_allochblk_nth): Update usage comment; if may_split is AVOID_SPLIT_REMAPPED and hhdr is unmapped then continue search instead of remapping memory and splitting the block.
* Minor code refactoring of GC_allochblk_nthIvan Maidanski2012-02-141-11/+12
| | | | | | * allchblk.c (N_HBLK_FLS): Enclose in parentheses. * allchblk.c (GC_allochblk_nth): Reformat comment; move GC_install_header invocation out of conditional expression.
* Code refactoring of GC_remove_from_flIvan Maidanski2012-02-131-43/+30
| | | | | | | | | | | | | | | | * allchblk.c (INCR_FREE_BYTES, FREE_ASSERT, FL_UNKNOWN): Remove. * allchblk.c (PHDR, NHDR): Enclose argument in parentheses. * allchblk.c (IS_MAPPED): Replace 1 with TRUE. * allchblk.c (GC_remove_from_fl, GC_add_to_fl, GC_split_block): Expand FREE_ASSERT and INCR_FREE_BYTES macros. * allchblk.c (GC_remove_from_fl): Decouple to GC_remove_from_fl_at (for known free list index) and to single-argument GC_remove_from_fl; update the comment. * allchblk.c (GC_merge_unmapped, GC_get_first_part, GC_allochblk_nth, GC_freehblk): Adjust GC_remove_from_fl invocation. * allchblk.c (GC_split_block): Make assertion on GC_free_bytes element stricter (check for overflow). * allchblk.c (GC_free_block_ending_at, GC_add_to_fl): Reformat comment.
* Do not avoid splitting if nothing currently unmapped (USE_MUNMAP)Ivan Maidanski2012-02-131-46/+19
| | | | | | | | | | | | | | * allchblk.c (GC_free_bytes, GC_enough_large_bytes_left, GC_compute_large_free_bytes): Define even for USE_MUNMAP case. * allchblk.c (INCR_FREE_BYTES, FREE_ASSERT): Always define as non-empty. * allchblk.c (GC_compute_large_free_bytes, GC_print_hblkfreelist, GC_remove_from_fl): Remove check of USE_MUNMAP (same implementation as if without memory unmapping). * allchblk.c (GC_compute_large_free_bytes): Remove FIXME. * allchblk.c (GC_allochblk): Do not avoid splitting if GC_unmapped_bytes is zero (meaning nothing unmapped); add FIXME to relax the condition.
* Minor code refactoring of GC_freehblk (change type of local variable)Ivan Maidanski2012-02-121-8/+6
| | | | | | * allchblk.c (GC_freehblk): Change type of "size" local variable from singed_word to word; cast "hbp" to ptr_t instead of word (for getting "next" address).
* Refine documentation comments and minor code refactoring in allchblk.cIvan Maidanski2012-02-011-17/+12
| | | | | | | | | * allchblk.c (GC_enough_large_bytes_left, GC_allochblk_nth): Refine and reformat comment. * allchblk.c (INCR_FREE_BYTES): Add missing parentheses. * allchblk.c (GC_allochblk): Remove "i" and nested "result" local variable declarations; replace "return" statement in the trailing loop with "break" (code refactoring).
* Add assertions to check GC_large_free_bytes and GC_root_size values byIvan Maidanski2012-01-311-9/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | GC_finish_collection even if GC_dump_regularly is off * allchblk.c (GC_compute_large_free_bytes): New inner function (defined only if GC_ASSERTIONS or not NO_DEBUGGING). * mark_rts.c (GC_compute_root_size): Likewise. * allchblk.c (GC_print_hblkfreelist): Call GC_compute_large_free_bytes instead of computing large_free_bytes itself (only if not USE_MUNMAP for now); remove "sz" local variable. * allchblk.c (GC_print_hblkfreelist): Refine logged messages (for total value). * mark_rts.c (GC_print_static_roots): Likewise. * include/private/gc_priv.h (GC_dump_regularly, COND_DUMP): Move definition down below GC_ASSERT one. * include/private/gc_priv.h (GC_compute_large_free_bytes, GC_compute_root_size): New function declaration (only if GC_ASSERTIONS). * include/private/gc_priv.h (COND_DUMP_CHECKS): New macro (invoke GC_ASSERT for GC_large_free_bytes and GC_root_size). * include/private/gc_priv.h (COND_DUMP): Invoke COND_DUMP_CHECKS unless GC_dump_regularly. * mark_rts.c (GC_print_static_roots): Call GC_compute_root_size instead of computing root size itself; rename "total" local variable to "size".
* Fix FREE_ASSERT usage (fix missing trailing semi-colon)Ivan Maidanski2012-01-311-2/+2
| | | | | * allchblk.c (GC_add_to_fl): Append ';' after FREE_ASSERT(). * allchblk.c (GC_remove_from_fl): Fix a typo in a comment.
* Refactoring: rename GC_PRIdPTR to WARN_PRIdPTRIvan Maidanski2011-12-291-1/+1
| | | | | | | | | | | | * allchblk.c (GC_allochblk_nth): Rename GC_PRIdPTR to WARN_PRIdPTR. * alloc.c (GC_collect_or_expand): Likewise. * include/private/gc_priv.h (GC_PRIdPTR): Likewise. * pthread_support.c (start_mark_threads, GC_thr_init): Likewise. * GC_thr_init (GC_delete_thread): Likewise. * include/private/gc_priv.h (WARN): Add comment about argument format specifier. * include/private/gc_priv.h (GC_PRIdPTR): Remove commented out code; refine comment.
* Review 'disclaim' add-on partially; fix code in some placesIvan Maidanski2011-09-301-0/+1
|
* Add disclaim callbacks for efficient finalization.Petter Urkedal2011-09-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Importing gc-20070403-disclaim-1.0.patch. * configure.ac: Add --disable-disclaim option and set ENABLE_DISCLAIM macro and conditional accordingly. * include/include.am, Makefile.am Add sources disclaim.c and include/gc_disclaim.h. * Makefile.direct: Ditto and define ENABLE_DISCLAIM. * include/private/gc_priv.h (obj_kind): Add ok_mark_unconditionally, ok_disclaim_proc and ok_disclaim_cd. * misc.c (GC_new_kind_inner): Initialize them. * include/private/gc_priv.h (hblkhdr): Add HAS_DISCLAIM and MARK_UNCONDITIONALLY flags. * allchblk.c (setup_header): Set HAS_DISCLAIM and MARK_UNCONDITIONALLY flags as indicated by the object kind. * reclaim.c: Main adjustments to support the disclaim callbacks. * mark.c (GC_push_unconditionally, GC_push_next_marked_uncollecable): Unconditionally mark from objects in blocks flagged MARK_UNCONDITIONALLY. This preserves links reachable from the finalizer when using the the finalized object kind. * disclaim.c: Add file with support functions for disclaim callbacks and implementation of the "finalized" object kind. * include/gc_disclaim.h: Add file providing the corresponding API. * include/private/thread_local_alloc.h (thread_local_freelists): Add finalized_freelists. * thread_local_alloc.c: Initialize them. * tests/tests.am, tests/disclaim_test.c, tests/disclaim_bench.c: Add disclaim-related tests.
* Resolve some minor warnings reported by GCC with '-pedantic' optionIvan Maidanski2011-09-301-3/+5
| | | | | | | * allchblk.c (GC_print_hblkfreelist, GC_dump_regions, GC_freehblk): Explicitly cast a pointer argument of GC_printf to void* to match %p format specifier. * reclaim.c (GC_print_free_list): Likewise.
* Resolve "comparison of signed and unsigned values" compiler warnings.Ivan Maidanski2011-08-211-5/+5
| | | | | | | | | | | | | | | | | * 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-03 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2011-01-17 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+5
| | | | | | | | | | * allchblk.c (GC_use_entire_heap): Change type to int (as declared in gc.h); set the default value depending on new GC_USE_ENTIRE_HEAP macro. * misc.c (GC_init): Test GC_USE_ENTIRE_HEAP environment variable to alter the default value of GC_use_entire_heap. * doc/README.environment (GC_USE_ENTIRE_HEAP): Document. * doc/README.macros (GC_USE_ENTIRE_HEAP): Ditto.
* 2010-12-02 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | * allchblk.c (GC_freehblk): Print extended error message (done via GC_printf() before aborting with a short message) only if GC_print_stats. * dyn_load.c (GC_register_dynamic_libraries): Ditto. * os_dep.c (GC_get_maps, GC_register_data_segments, GC_remap, PROTECT, GC_write_fault_handler, GC_mprotect_thread): Ditto. * pthread_stop_world.c (GC_start_world): Ditto. * win32_threads.c (GC_register_my_thread_inner): Ditto. * os_dep.c (GC_get_main_stack_base, GC_register_data_segments, GC_dirty_init): Remove redundant print of an error message before aborting with the same message. * os_dep.c (GC_register_data_segments): Remove format specifier from the string passed to GC_err_puts(); use ABORT instead of EXIT (if invalid executable type). * os_dep.c (GC_remap): Adjust printf format specifier (for long type). * os_dep.c (GC_dirty_init): Print a message about SIG_IGN detected (for SIGSEGV/BUS) only if GC_print_stats. * os_dep.c (catch_exception_raise): Join 2 adjucent GC_err_printf calls.
* 2009-12-08 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-6/+7
| | | | | | | | | | | | | | | | | | | | | | | * 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-11-06 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+1
| | | | | | | | | | | | | * dyn_load.c (WIN32_LEAN_AND_MEAN): Guard with ifndef. * misc.c (WIN32_LEAN_AND_MEAN): Ditto. * os_dep.c (WIN32_LEAN_AND_MEAN): Ditto. * allchblk.c (GC_allochblk_nth): Fix a minor typo (don't/doesn't) in a comment. * backgraph.c: Ditto. * dyn_load.c (GC_register_dynamic_libraries): Ditto. * extra/threadlibs.c (main): Ditto. * pthread_support.c (pthread_join): Ditto. * tests/test.c (main): Ditto.
* 2009-10-22 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * allchblk.c (GC_unmap_old, GC_merge_unmapped, GC_allochblk, GC_freehblk): Use GC_INNER for the function definition. * alloc.c (GC_never_stop_func, GC_should_collect, GC_try_to_collect_inner, GC_collect_a_little_inner, GC_set_fl_marks, GC_add_to_our_memory, GC_add_to_heap, GC_expand_hp_inner, GC_collect_or_expand, GC_allocobj): Ditto. * backgraph.c (GC_build_back_graph, GC_traverse_back_graph): Ditto. * blacklst.c (GC_default_print_heap_obj_proc, GC_bl_init, GC_promote_black_lists, GC_unpromote_black_lists, GC_add_to_black_list_normal, GC_add_to_black_list_stack, GC_is_black_listed): Ditto. * darwin_stop_world.c (GC_push_all_stacks, GC_push_all_stacks, GC_stop_init, GC_stop_world, GC_start_world): Ditto. * dbg_mlc.c (GC_has_other_debug_info, GC_store_back_pointer, GC_marked_for_finalization, GC_generate_random_backtrace_no_gc, GC_store_debug_info, GC_start_debugging, GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page, GC_debug_malloc_uncollectable, GC_debug_free_inner): Ditto. * dyn_load.c (GC_register_dynamic_libraries, GC_register_main_static_data, GC_init_dyld): Ditto. * finalize.c (GC_push_finalizer_structures, GC_finalize, GC_notify_or_invoke_finalizers, GC_print_finalization_stats): Ditto. * gcj_mlc.c (GC_core_gcj_malloc): Ditto. * headers.c (GC_find_header, GC_header_cache_miss, GC_scratch_alloc, GC_init_headers, GC_install_header, GC_install_counts, GC_remove_header, GC_remove_counts, GC_next_used_block, GC_prev_block): Ditto. * mach_dep.c (GC_with_callee_saves_pushed): Ditto. * malloc.c (GC_collect_or_expand, GC_alloc_large, GC_generic_malloc_inner, GC_generic_malloc_inner_ignore_off_page, GC_core_malloc_atomic, GC_core_malloc, GC_free_inner): Ditto. * mallocx.c (GC_generic_malloc_ignore_off_page): Ditto. * mark.c (GC_collection_in_progress, GC_clear_hdr_marks, GC_set_hdr_marks, GC_set_mark_bit, GC_clear_mark_bit, GC_clear_marks, GC_initiate_gc, GC_mark_some, GC_mark_stack_empty, GC_invalidate_mark_state, GC_signal_mark_stack_overflow, GC_mark_from, GC_help_marker, GC_mark_init, GC_push_all, GC_push_conditional, GC_mark_and_push_stack, GC_push_all_eager, GC_push_all_stack): Ditto. * mark_rts.c (GC_is_static_root, GC_roots_present, GC_approx_sp, GC_exclude_static_roots_inner, GC_push_all_register_frames, GC_push_all_stack_frames, GC_cond_register_dynamic_libraries, GC_push_roots): Ditto. * misc.c (GC_extend_size_map, GC_clear_stack, GC_err_write): Ditto. * new_hblk.c (GC_build_fl, GC_new_hblk): Ditto. * obj_map.c (GC_register_displacement_inner, GC_add_map_entry, GC_initialize_offsets): Ditto. * os_dep.c (GC_get_maps, GC_parse_map_entry, GC_text_mapping, GC_init_linux_data_start, GC_init_netbsd_elf, GC_setpagesize, GC_set_and_save_fault_handler, GC_setup_temporary_fault_handler, GC_reset_fault_handler, GC_get_register_stack_base, GC_init_win32, GC_add_current_malloc_heap, GC_is_heap_base, GC_unmap, GC_remap, GC_unmap_gap, GC_push_all_stacks, GC_gww_dirty_init, GC_dirty_init, GC_read_dirty, GC_page_was_dirty, GC_page_was_ever_dirty, GC_remove_protection, GC_write_fault_handler, GC_mprotect_stop, GC_mprotect_resume, GC_save_callers, GC_print_callers): Ditto. * pthread_stop_world.c (GC_push_all_stacks, GC_stop_world, GC_start_world, GC_stop_init): Ditto. * pthread_support.c (GC_mark_thread_local_free_lists, GC_lookup_thread, GC_reset_finalizer_nested, GC_check_finalizer_nested, GC_segment_is_thread_stack, GC_greatest_stack_base_below, GC_thr_init, GC_init_parallel, GC_do_blocking_inner, GC_lock, GC_acquire_mark_lock, GC_release_mark_lock, GC_wait_for_reclaim, GC_notify_all_builder, GC_wait_marker, GC_notify_all_marker): Ditto. * reclaim.c (GC_print_all_errors, GC_block_empty, GC_reclaim_generic, GC_start_reclaim, GC_continue_reclaim, GC_reclaim_all): Ditto. * thread_local_alloc.c (GC_init_thread_local, GC_destroy_thread_local, GC_mark_thread_local_fls_for): Ditto. * win32_threads.c (GC_reset_finalizer_nested, GC_check_finalizer_nested, GC_do_blocking_inner, GC_stop_world, GC_start_world, GC_push_all_stacks, GC_get_next_stack, GC_acquire_mark_lock, GC_release_mark_lock, GC_wait_for_reclaim, GC_notify_all_builder, GC_wait_marker, GC_notify_all_marker, GC_thr_init, GC_init_parallel, GC_lock, GC_mark_thread_local_free_lists): Ditto. * alloc.c (GC_add_current_malloc_heap, GC_build_back_graph, GC_traverse_back_graph): Use GC_INNER for the function prototype. * darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume): 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): Ditto. * include/private/dbg_mlc.h (GC_save_callers, GC_print_callers, GC_has_other_debug_info, GC_store_debug_info): Ditto. * include/private/gc_hdrs.h (GC_header_cache_miss): Ditto. * include/private/gc_locks.h (GC_lock): Ditto. * include/private/gc_pmark.h (GC_signal_mark_stack_overflow, GC_mark_from): Ditto. * include/private/pthread_support.h (GC_lookup_thread, GC_stop_init): Ditto. * include/private/thread_local_alloc.h (GC_init_thread_local, GC_destroy_thread_local, GC_mark_thread_local_fls_for): Ditto. * malloc.c (GC_extend_size_map, GC_text_mapping): Ditto. * mark.c (GC_page_was_ever_dirty): 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_do_blocking_inner): Ditto. * os_dep.c (GC_greatest_stack_base_below): Ditto. * win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init): Ditto. * include/private/gc_priv.h: Ditto (for most prototypes). * include/private/gc_priv.h (GC_INNER): Update the comment. * doc/README.macros (GC_DLL): Update.
* 2009-10-21 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-2/+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-10-19 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/private/gc_priv.h (GC_INNER): New macro (for GC-scope variable definitions). * include/private/gc_priv.h (GC_EXTERN): Update the comment. * allchblk.c (GC_unmap_threshold): Define as GC_INNER. * alloc.c (GC_incremental, GC_world_stopped, GC_n_heap_sects, GC_n_memory, GC_fail_count): Ditto. * blacklst.c (GC_black_list_spacing, GC_print_heap_obj): Ditto. * gcj_mlc.c (GC_gcj_malloc_initialized, GC_gcjobjfreelist): Ditto. * mach_dep.c (GC_save_regs_ret_val): Ditto. * mark.c (GC_n_mark_procs, GC_obj_kinds, GC_n_kinds, GC_mark_stack, GC_mark_stack_limit, GC_mark_stack_size, GC_mark_stack_top, GC_mark_state, GC_mark_stack_too_small, GC_mark_no, GC_markers): Ditto. * mark_rts.c (GC_root_size, GC_push_typed_structures): Ditto. * misc.c (GC_allocate_ml, GC_debugging_started, GC_check_heap, GC_print_all_smashed, GC_print_back_height, GC_dump_regularly, GC_backtraces, GC_force_unmap_on_gcollect, GC_large_alloc_warn_interval, GC_is_initialized, GC_write_cs, GC_current_warn_proc, GC_blocked_sp, GC_activation_frame): Ditto. * os_dep.c (GC_page_size, GC_dont_query_stack_min, GC_no_win32_dlls, GC_wnt, GC_sysinfo, GC_push_other_roots, GC_dirty_maintained, GC_fault_handler_lock): Ditto. * pthread_support.c (GC_allocate_ml, GC_lock_holder, GC_need_to_lock, GC_thr_initialized, GC_threads, GC_in_thread_creation, GC_collecting, GC_allocate_lock, GC_mark_lock_holder): Ditto. * reclaim.c (GC_bytes_found, GC_fl_builder_count, GC_have_errors): Ditto. * win32_threads.c (GC_allocate_ml, GC_lock_holder, GC_need_to_lock, GC_mark_lock_holder, GC_collecting): Ditto. * extra/gc.c (GC_INNER, GC_EXTERN): Define as STATIC. * mach_dep.c (GC_with_callee_saves_pushed): Remove redundant {}. * os_dep.c (GC_init_win32): Reformat the comment.
* 2009-10-18 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Move the variable declaration to gc_priv.h. * alloc.c (GC_bytes_found, GC_unmap_threshold, GC_force_unmap_on_gcollect): Ditto. * dyn_load.c (GC_no_win32_dlls, GC_wnt): Ditto. * finalize.c (GC_fail_count): Ditto. * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder, GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Ditto. * include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size, GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack, GC_mark_stack_too_small, GC_mark_state): Ditto. * include/private/pthread_support.h (GC_threads, GC_thr_initialized, GC_in_thread_creation): Ditto. * mallocx.c (GC_bytes_found): Ditto. * mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Ditto. * misc.c (GC_unmap_threshold): Ditto. * os_dep.c (GC_unmap_threshold): 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_fault_handler_lock, GC_write_cs, GC_dont_query_stack_min, GC_markers, GC_wnt): Ditto. * include/private/gc_priv.h (GC_EXTERN): New macro (used mostly as a tag for now); defined after "gcconfig.h" inclusion. * include/private/gc_priv.h: Use GC_EXTERN instead of "extern" keyword for most global variables. * alloc.c (GC_copyright): Add the comment about the symbol visibility. * finalize.c (GC_fo_entries): Ditto. * include/private/gc_priv.h (GC_print_stats): Ditto. * misc.c (GC_quiet): Ditto. * mallocx.c (GC_bytes_allocd_tmp): Make the volatile variable STATIC. * pthread_support.c (GC_threads): Add explicit zero initializer (to make the variable definition differ from the declaration).
* 2009-10-17 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * alloc.c (GC_never_stop_func, GC_check_fl_marks, GC_finish_collection): Reformat the code (make opening bracket style uniform across the file). * allchblk.c (GC_allochblk): Ditto. * backgraph.c (add_edge): Ditto. * dbg_mlc.c (GC_marked_for_finalization): Ditto. * dyn_load.c (GC_register_dynamic_libraries, GC_init_dyld): Ditto. * finalize.c (GC_null_finalize_mark_proc): Ditto. * gc_dlopen.c (GC_dlopen): Ditto. * mark.c (GC_push_marked1, GC_push_marked2, GC_push_marked4): Ditto. * misc.c (looping_handler, GC_call_with_gc_active, GC_do_blocking_inner, GC_do_blocking): Ditto. * os_dep.c (GC_get_main_stack_base, GC_read_dirty): Ditto. * pthread_support.c (GC_pthread_create, GC_pthread_sigmask, GC_pthread_join, GC_pthread_detach, GC_check_tls, GC_do_blocking_inner, GC_call_with_gc_active): Ditto. * reclaim.c (GC_reclaim_clear, GC_reclaim_block, GC_print_free_list): Ditto. * os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty, GC_remove_protection): Reformat the code (wrap long lines).
* 2009-10-08 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+1
| | | | | | | | | | | | | | | | | | | * Makefile.direct: Move "define arguments" documentation to doc/README.macros; add reference to doc/README.macros. * Makefile.dj: Change the documentation reference to doc/README.macros. * README.QUICK: Ditto. * configure.ac: Ditto. * allchblk.c: Remove unnecessary "-D" from the comment. * doc/README.macros: Ditto. * README.environment: Ditto. * include/gc.h: Ditto. * include/gc_inline.h: Ditto. * include/private/gcconfig.h: Ditto. * README.QUICK: Fix a typo. * README.QUICK: Expand all tabs to spaces. * configure: Regenerate. * include/private/config.h.in: Ditto.
* 2009-10-01 Ivan Maidanski <ivmai@mail.ru> (really mostly Andreas Tobler)ivmai2011-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | | * allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Add "extern" keyword to a global variable declaration (some compilers require it). * alloc.c (GC_bytes_found, GC_unmap_threshold, GC_force_unmap_on_gcollect): Ditto. * dyn_load.c (GC_no_win32_dlls, GC_wnt): Ditto. * finalize.c (GC_fail_count): Ditto. * include/private/gc_hdrs.h (GC_hdr_cache_hits, GC_hdr_cache_misses): Ditto. * mallocx.c (GC_bytes_found): Ditto. * mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Ditto. * misc.c (GC_unmap_threshold): Ditto. * os_dep.c (GC_unmap_threshold, 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_fault_handler_lock, GC_write_cs, GC_dont_query_stack_min, GC_markers, GC_wnt): Ditto.
* 2009-09-30 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-27 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * allchblk.c (GC_hblkfreelist): Define as STATIC. * blacklst.c (GC_total_stack_black_listed): Ditto. * include/private/gc_priv.h (GC_hblkfreelist, GC_stopped_mark, GC_total_stack_black_listed, GC_push_stubborn_structures): Remove declaration. * mark_rts.c (GC_stopped_mark): Add declaration (only if THREAD_LOCAL_ALLOC). * allchblk.c (GC_fail_count): Move the declaration out of GC_allochblk_nth(); remove "extern". * alloc.c (IF_THREADS): Remove unused macro. * alloc.c (GC_world_stopped): Define only if THREAD_LOCAL_ALLOC. * alloc.c (GC_stopped_mark): Set GC_world_stopped value only if THREAD_LOCAL_ALLOC. * alloc.c (GC_bytes_found, GC_collection_in_progress, GC_check_tls, GC_unmap_threshold, GC_force_unmap_on_gcollect): Remove K&R-style "extern" for the declaration. * dbg_mlc.c (GC_free_inner): Ditto. * dyn_load.c (GC_repeat_read, GC_roots_present, GC_is_heap_base, GC_get_next_stack, GC_no_win32_dlls, GC_wnt): Ditto. * finalize.c (GC_fail_count): Ditto. * include/private/gc_hdrs.h (GC_hdr_cache_hits, GC_hdr_cache_misses): Ditto. * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder, GC_lock, GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Ditto. * include/private/gc_pmark.h (GC_mark_procs, GC_n_mark_procs, GC_mark_stack_size, GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack, GC_mark_stack_too_small, GC_mark_state): Ditto. * include/private/gc_priv.h (GC_current_warn_proc, GC_obj_kinds, GC_n_kinds, GC_fo_entries, GC_n_heap_sects, GC_n_memory, GC_page_size, GC_sysinfo, GC_black_list_spacing, GC_objects_are_marked, GC_incremental, GC_dirty_maintained, GC_root_size, GC_debugging_started, GC_large_alloc_warn_interval, GC_large_alloc_warn_suppressed, GC_blocked_sp, GC_activation_frame, GC_push_other_roots, GC_push_finalizer_structures, GC_push_thread_structures, GC_push_typed_structures, GC_start_call_back, GC_is_initialized, GC_check_heap, GC_print_all_smashed, GC_print_all_errors, GC_print_heap_obj, GC_have_errors, GC_print_stats, GC_dump_regularly, GC_backtraces, GC_print_back_height, GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page, GC_fl_builder_count, GC_mark_no, GC_help_marker, GC_setup_temporary_fault_handler, GC_reset_fault_handler): Ditto. * include/private/gcconfig.h (GC_SysVGetDataStart, GC_FreeBSDGetDataStart, GC_register_stackbottom, GC_MacTemporaryNewPtr, GC_amiga_get_mem): Ditto. * include/private/pthread_support.h (GC_threads, GC_thr_initialized, GC_in_thread_creation): Ditto. * malloc.c (GC_text_mapping): Ditto. * mallocx.c (GC_bytes_found): Ditto. * mark.c (GC_check_dirty, GC_started_thread_while_stopped): Ditto. * mark_rts.c (GC_save_regs_ret_val): Ditto. * misc.c (GC_clear_stack_inner, GC_init_parallel, GC_init_win32, GC_setpagesize, GC_init_linux_data_start, GC_set_and_save_fault_handler, GC_unmap_threshold): Ditto. * os_dep.c (GC_unmap_threshold, GC_push_all_stacks, GC_darwin_register_mach_handler_thread): Ditto. * pthread_support.c (GC_markers, GC_collection_in_progress): Ditto. * tests/test.c (GC_amiga_free_all_mem): Ditto. * thread_local_alloc.c (GC_gcjobjfreelist, GC_gcj_malloc_initialized, GC_gcj_kind): Ditto. * win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init, GC_fault_handler_lock, GC_write_cs, GC_markers): Ditto. * misc.c (GC_read, GC_register_finalizer_no_order, GC_init_dyld): Move the declaration out of GC_init(); remove "extern". * os_dep.c (GC_abort): Add the comment; add workaround to suppress compiler "unreachable code" warnings for ABORT callers (where ABORT is followed by a dummy return statement). * os_dep.c (GC_old_allocator): Move the declaration out of GC_default_push_other_roots(); remove "extern". * darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume): Move the declaration out of GC_stop_world() and GC_start_world() (only if MPROTECT_VDB); remove "extern".
* 2009-09-26 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-4/+1
| | | | | | | | | | | | | | | * allchblk.c (GC_enough_large_bytes_left): Replace "inline static" with GC_INLINE. * include/private/gc_priv.h (fixed_getenv): Ditto. * alloc.c (GC_max, GC_min): Replace "static INLINE" with GC_INLINE. * mark_rts.c (rt_hash): Ditto. * win32_threads.c (GC_get_max_thread_index): Ditto. * include/private/gc_priv.h (INLINE): Prefix with "GC_"; include "static"; define for Sun CC; define for VC++ (and other compilers). * pthread_support.c: Don't define __inline__ for non-GNU compilers (not needed anymore).
* 2009-09-20 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-4/+3
| | | | | | | | | * allchblk.c (GC_freehblk): Adjust local variables indentation. * mallocx.c (GC_generic_malloc_many): Ditto. * typd_mlc.c (GC_malloc_explicitly_typed_ignore_off_page, GC_calloc_explicitly_typed): Ditto. * typd_mlc.c (GC_make_array_descriptor): Remove unnecessary brackets.
* 2009-09-19 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-380/+379
| | | | | | | | | | | | | * allchblk.c: Expand all tabs to spaces; remove trailing spaces at EOLn; remove multiple trailing blank lines. * mark.c: Ditto. * mark_rts.c: Ditto. * pthread_stop_world.c: Ditto. * win32_threads.c: Ditto. * include/gc.h: Ditto. * include/private/gc_priv.h: Ditto. * pthread_stop_world.c: Add copyright header. * include/gc.h: Reformat some comments.
* 2009-09-17 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+1
| | | | | | | | | | | | | | | | (ivmai139.diff) * allchblk.c (GC_allochblk_nth): Use GC_PRIdPTR in WARN() format string. * pthread_support.c (start_mark_threads, GC_thr_init): Ditto. * win32_threads.c (GC_delete_thread): Ditto. * include/private/gc_priv.h (GC_PRIdPTR): New macro. * pthread_stop_world.c (GC_suspend_handler_inner): Remove unnecessary cast for WARN argument. * pthread_support.c (start_mark_threads): if pthread_create() failed then don't try to create other marker threads and (after printing a warning) adjust GC_markers and GC_parallel values; log GC_markers value (possibly adjusted) after that.
* 2009-09-10 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-11/+13
| | | | | | | | | | | | | | | | (diff118_cvs - superseding diff53) * allchblk.c (MUNMAP_THRESHOLD): Move macro definition out of a function. * allchblk.c (GC_unmap_threshold): New global variable definition (initialized to MUNMAP_THRESHOLD). * allchblk.c (GC_unmap_old): Use GC_unmap_threshold instead of MUNMAP_THRESHOLD; skip unmapping if GC_unmap_threshold is 0. * doc/README.environment (GC_UNMAP_THRESHOLD): Add information. * misc.c (GC_unmap_threshold): New variable declaration. * misc.c (GC_init_inner): Recognize "GC_UNMAP_THRESHOLD" environment variable to set GC_unmap_threshold value (only if USE_MUNMAP).
* 2009-08-11 Hans Boehm <Hans.Boehm@hp.com>hboehm2011-07-261-12/+14
| | | | | | | | | | | | (Replacement for Ivan Maidanski's diff99_cvs. Hopefully fixes the same bugs, and then some.) * allchblk.c (GC_merge_unmapped): Don't assume that adjacent free blocks have different mapping status. Correctly handle gap between blocks. (GC_split_block): Remove dead code setting hb_flags. Add comment. (GC_allochblk): Split blocks also in generational-only mode. * os_dep.c (GC_unmap_gap): Dont really use munmap.
* 2009-06-20 Hans Boehm <Hans.Boehm@hp.com>hboehm2011-07-261-0/+3
| | | | | | | | | | * 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.
* 2009-06-11 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)hboehm2011-07-261-22/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (diff92_cvs: resembling diff20, diff27, diff34, diff38, diff43, diff45, diff46, diff56, diff60, diff62, diff74, diff75, diff81 partly) * allchblk.c (GC_print_hblkfreelist, GC_dump_regions): Convert a group of printf() calls into a single one (for output atomicity). * include/gc.h (GC_set_all_interior_pointers, GC_set_full_freq, GC_set_time_limit): New prototypes. * misc.c (GC_set_all_interior_pointers, GC_set_full_freq, GC_set_time_limit): New public setter/getter functions. * include/gc.h: Fix (and remove outdated) comments for thread-local allocation. * include/gc.h: Fix typos in comments. * misc.c (GC_init_inner, GC_printf): Ditto. * include/gc.h (GC_unregister_disappearing_link): Refine comment. * include/gc.h (GC_stack_base): Recognize _M_IA64 macro. * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset, DEGRADE_RATE): Define only if THREADS. * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset): Define as STATIC. * misc.c (GC_get_heap_size, GC_get_free_bytes, GC_get_bytes_since_gc, GC_get_total_bytes): Acquire the GC lock to avoid data races. * misc.c (GC_write_cs): Define only if THREADS (Win32/WinCE only). * misc.c (GC_init_inner): Initialize GC_write_cs only if THREADS. * misc.c (GC_init_inner): Use GC_INITIAL_HEAP_SIZE (if available) to set the default initial value of initial_heap_sz. * misc.c (GC_deinit): Destroy GC_write_cs only if THREADS. * misc.c (GC_init_inner): Fix WARN() format specifier (should be word-complient, "%p" is used w/o "0x"). * misc.c (GC_init_inner): Don't recognize "GC_PAUSE_TIME_TARGET" environment variable if SMALL_CONFIG. * misc.c (GC_init_inner): Recognize "GC_FULL_FREQUENCY" environment variable to set initial GC_full_freq value (if not SMALL_CONFIG). * doc/README.environment (GC_FULL_FREQUENCY): Add information. * doc/README.environment (GC_MARKERS): Refine information. * misc.c (GC_init_inner): Change GC_ASSERT to GC_STATIC_ASSERT where possible. * misc.c (IF_NEED_TO_LOCK): New macro (instead of GC_need_to_lock). * misc.c (GC_write): Use IF_NEED_TO_LOCK for handling GC_write_cs. * misc.c (GC_abort): Don't define if SMALL_CONFIG. * misc.c (GC_abort): Directly use WRITE() instead of GC_err_printf() (to prevent possible infinite recursion).
* 2009-02-28 Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidansky)hboehm2011-07-261-2/+2
| | | | | | | | | | | | * allchblk.c, backgraph.c, dbg_mlc.c, dyn_load.c, finalize.c, include/private/gc_pmark.h, malloc.c, mark.c, os_dep.c, pthread_stop_world.c, pthread_support.c, reclaim.c, thread_local_alloc.c. * misc.s: Refine comment. 2009-02-28 Hans Boehm <Hans.Boehm@hp.com> * os_dep.c: Define GC_GWW_BUF_LEN more intelligently. Add FIXME comment.
* 2008-07-25 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)hboehm2011-07-261-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 2008-03-10 Hans Boehm <Hans.Boehm@hp.com>hboehm2011-07-261-0/+3
| | | | | | | | * allchblk.c (GC_allochblk): Check for overflow during size rounding. * tests/huge_test.c: New. * Makefile.direct, tests/tests.am: Add huge_test.c * Makefile.in: Regenerate.
* 2008-02-20 Hans Boehm <Hans.Boehm@hp.com>hboehm2011-07-261-3/+7
| | | | | | * allchblk.c (add_to_fl): disable assertions with USE_MUNMAP, and refine assertions to handle huge unmergable blocks. (GC_allochblk_nth): Add comment.
* 2008-02-20 Hans Boehm <Hans.Boehm@hp.com>hboehm2011-07-261-50/+66
| | | | | | | | | | | | | | | | * allchblk.c (GC_enough_large_bytes_left): No longer take parameters; return free list index bound. (GC_merge_unmapped): Don't access nexthdr until after null test. (Fixes bug in 1/29/08 check-in.) (GC_allochblk): Calculate when splitting is allowable only once here, not when considering each block. (GC_allchblk_nth): Accept new may_split parameter. Avoid some redundant tests for exact size matches. * alloc.c (GC_should_collect): Cache min_bytes_allocd. (GC_maybe_gc): Make locking assertion testable. * mark_rts.c: Fix indentation. * pthread_stop_world.c: Replace old GC_err_printf1 reference. * tests/test.c: Remove (void) casts. Optionally print some timing information.
* 2008-01-29 Hans Boehm <Hans.Boehm@hp.com>hboehm2011-07-261-4/+13
| | | | | | | * allchblk.c (GC_merge_unmapped, GC_freehblk): Refuse to create blocks large enough that their size, when interpreted as a signed value, would be negative. * include/private/gc_priv.h: Comment hb_sz range limit.
* 2007-01-03 Hans Boehm <Hans.Boehm@hp.com> (based on a patch fromhboehm2011-07-261-0/+1
| | | | | | | | John Bowman, and an ancient patch from Fergus Henderson) * allchblk.c, alloc.c, include/private/gc_priv.h: Track GC_bytes_dropped and use in GC triggering decisions. * alloc.c (min_bytes_allocd): Weight atomic blocks less.
* 2007-12-18 Hans Boehm <Hans.Boehm@hp.com>hboehm2011-07-261-2/+4
| | | | | | | | | * gc_cpp.cc: Don't include gc_cpp.h from local directory. 2007-12-18 Hans Boehm <Hans.Boehm@hp.com> (really Adam Megacz) * allchblk.c, configure.ac (add --enable-munmap) * configure: Regenerate.
* 2007-10-23 Hans Boehm <Hans.Boehm@hp.com>hboehm2011-07-261-0/+2
| | | | | * malloc.c: Update GC_large_allocd_bytes on explicit deallocation. * allchblk.c: Sanity check GC_max_large_allocd_bytes.
* 2007-06-06 Hans Boehm <Hans.Boehm@hp.com>hboehm2011-07-261-37/+21
| | | | | | | | | | | | | | | | | | | * 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.0alpha5 tarball importgc7_0alpha5Ivan Maidanski2011-07-261-6/+6
|
* gc7.0alpha4 tarball importgc7_0alpha4Ivan Maidanski2011-07-261-1/+1
|