summaryrefslogtreecommitdiff
path: root/os_dep.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 2011-04-02 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-76/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-03-22 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-6/+4
| | | | | | | | | * misc.c (GC_abort): Use _exit() (instead of DebugBreak) on Win32 when doing code static analysis (to inform the tool that the function is a no-return one). * os_dep.c (GC_linux_stack_base): Remove a duplicate validation of the length of "stat" file; use signed int type for "i", "buf_offset" and "len" local variables (since read() may return -1).
* 2011-03-13 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-15/+27
| | | | | | | | | | | | | | | | | | | * dbg_mlc.c (GC_get_back_ptr_info, GC_print_obj, GC_print_smashed_obj, GC_debug_free_inner): Add a code for a LINT-like tool to instruct it that the function is invoked only with valid parameters (otherwise a SEGV is ok); recognize LINT2 new macro. * misc.c (GC_abort): Instruct a LINT-like tool that the function never returns in fact. * os_dep.c (GC_linux_stack_base): Check for read buffer overflow; close the file immediately after read; use STRTOULL() instead of decoding the address number manually. * include/private/gc_priv.h (EXPECT): Don't specify outcome for a LINT-like tool. * include/private/gc_priv.h (GC_all_interior_pointers): Instruct a LINT-like tool that the value is restricted to zero and one only (required since the variable is global and its value is used as a part of array index expression is some places).
* 2011-03-13 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-3/+5
| | | | | | | | | | | | | | | | | | | | * dbg_mlc.c (GC_make_closure): Fix SEGV in case GC_malloc returns NULL. * dbg_mlc.c (GC_debug_register_finalizer, GC_debug_register_finalizer_no_order, GC_debug_register_finalizer_unreachable, GC_debug_register_finalizer_ignore_self): Handle out of memory case properly (similar to GC_register_finalizer_inner). * headers.c (GC_install_header): Handle the case when alloc_hdr() returns NULL. * os_dep.c (GC_get_maps_len): Defend against missing "maps" file. * pthread_support.c (GC_mark_thread): Place a dummy return statement (which uses "id" argument) before the actual use of "id" as an array index (to suppress a warning produced by some static code analysis tools). * win32_threads.c (GC_mark_thread): Ditto. * pthread_support.c (GC_thr_init): Abort (with the appropriate message) if out of memory.
* 2011-02-20 Ivan Maidanski <ivmai@mail.ru> (mostly really Elijah Taylor)ivmai2011-07-261-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gc_dlopen.c: Empty unit for NaCl. * os_dep.c: Include fcntl.h for NaCl. * os_dep.c (GC_get_main_stack_base): Ignore USE_GET_STACKBASE_FOR_MAIN macro for NaCl. * os_dep.c (GC_get_stack_base): Return GC_UNIMPLEMENTED for NaCl. * os_dep.c (GC_remap): Use mmap (instead of mprotect) for NaCl. * pthread_start.c (GC_inner_start_routine): Don't invoke pthread_cleanup_push/pop for NaCl. * pthread_stop_world.c (GC_nacl_num_gc_threads, GC_nacl_thread_idx, GC_nacl_park_threads_now, GC_nacl_thread_parker, GC_nacl_gc_thread_self, GC_nacl_thread_parked, GC_nacl_thread_used, GC_nacl_thread_parking_inited, GC_nacl_thread_alloc_lock): New variable (fo NaCl only). * pthread_stop_world.c (GC_suspend_handler): Reformat the code. * pthread_stop_world.c (GC_remove_allowed_signals, suspend_handler_mask, GC_stop_count, GC_world_is_stopped, GC_retry_signals, SIG_THR_RESTART, GC_suspend_ack_sem, GC_restart_ack_sem, GC_suspend_handler_inner, GC_suspend_handler, GC_restart_handler): Don't define for NaCl. * pthread_support.c (GC_get_nprocs): Ditto. * include/private/gc_priv.h (SIG_SUSPEND): Ditto. * include/private/gcconfig.h (LINUX): Ditto. * pthread_stop_world.c (GC_push_all_stacks): Push register storage for NaCl. * pthread_stop_world.c (GC_suspend_all, GC_stop_world, GC_start_world): Implement for NaCl. * pthread_stop_world.c (GC_stop_world): Don't define unused "i" local variable for OpenBSD (and NaCl). * pthread_stop_world.c (NACL_STORE_REGS): New macro definition for NaCl. * pthread_stop_world.c (nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed, nacl_post_syscall_hook, GC_nacl_initialize_gc_thread, GC_nacl_shutdown_gc_thread): New function (for NaCl only). * pthread_stop_world.c (GC_stop_init): Empty for NaCl. * pthread_support.c (pthread_cancel, pthread_sigmask): Don't redirect for NaCl. * include/gc_pthread_redirects.h (pthread_cancel, pthread_sigmask): Ditto. * pthread_support.c (GC_nacl_initialize_gc_thread, GC_nacl_shutdown_gc_thread): New internal prototype (NaCl only). * pthread_support.c (GC_new_thread, GC_delete_thread): Initialize and shutdown thread for NaCl. * pthread_support.c (GC_thr_init): Call sysconf for NaCl. * pthread_support.c (GC_pthread_exit): Call GC_thread_exit_proc for NaCl. * include/gc.h: Don't include features.h for NaCl. * include/gc_pthread_redirects.h (GC_PTHREAD_CONST): New macro. * include/gc_pthread_redirects.h (GC_pthread_create): Use GC_PTHREAD_CONST instead of const. * win32_threads.c (GC_pthread_create): Ditto. * pthread_support.c (GC_pthread_create_t, GC_pthread_create, pthread_create): Ditto. * include/private/gcconfig.h (NACL): Recognize NaCl. * include/private/gcconfig.h (GC_LINUX_THREADS): Valid for NaCl. * include/private/pthread_stop_world.h (thread_stop_info): Add reg_storage member; define NACL_GC_REG_STORAGE_SIZE macro (for NaCl only). * include/private/pthread_support.h (GC_nacl_gc_thread_self): Declare internal variable (for NaCl only).
* 2011-02-13 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-72/+86
| | | | | | | | | | | | | | | | | | | | | | | * mark.c (GC_mark_some): Prefix and suffix "asm" and "volatile" keywords with double underscore. * os_dep.c (GC_unix_get_mem): Reformat the code. * os_dep.c (catch_exception_raise, catch_exception_raise_state, catch_exception_raise_state_identity): Add GC_API_OSCALL to function definition. * os_dep.c (catch_exception_raise_state, catch_exception_raise_state_identity): Move definition to be before GC_ports. * os_dep.c (catch_exception_raise): Declare to have the symbol defined before GC_ports. * os_dep.c (GC_ports): Store references to catch_exception_raise, catch_exception_raise_state, catch_exception_raise_state_identity (to prevent stripping these symbols as dead). * os_dep.c (catch_exception_raise, catch_exception_raise_state, catch_exception_raise_state_identity): Mark these symbols as "referenced dynamically" via an assembler directive (unless NO_DESC_CATCH_EXCEPTION_RAISE). * include/private/gc_priv.h (GC_API_OSCALL): New macro (defined similar to GC_API but as if GC_DLL is always defined).
* 2011-02-10 Ivan Maidanski <ivmai@mail.ru> (with input from Dimitry Andric)ivmai2011-07-261-31/+31
| | | | | | | | | | | * os_dep.c: Don't include signal.h for GC_write_fault_handler on Win32. * os_dep.c (SIG_OK): Don't return true unless SIGSEGV or SIGBUS on FreeBSD. * os_dep.c (CODE_OK): Use SEGV_ACCERR on FreeBSD (define SEGV_ACCERR for older FreeBSD releases). * os_dep.c (SIG_OK, CODE_OK, GC_write_fault_handler): Reformat the code.
* 2011-02-10 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-341/+345
| | | | | | | | | | | | | | | | | | | | | * os_dep.c (GC_setpagesize, GC_task_self, PROTECT, UNPROTECT): Reorder to remove redundant ifdef for Win32. * os_dep.c: Add comment to some endif. * os_dep.c: Include pthread.h (for Linux even if single-threaded) if USE_GET_STACKBASE_FOR_MAIN; also include it for Darwin. * os_dep.c (STACKBOTTOM): Redefine for Darwin (unless prohibited for some reason). * os_dep.c (GC_get_main_stack_base): Allow USE_GET_STACKBASE_FOR_MAIN for Linux even if single-threaded; add assertion for the returned result. * os_dep.c (GC_get_stack_base): Define for Darwin if multi-threaded. * os_dep.c (GC_page_was_dirty): Reformat the code. * os_dep.c: Reformat some comments. * os_dep.c (SIG_OK, CODE_OK): Add comment (for FreeBSD). * os_dep.c (ID_STOP, ID_RESUME): Define only if threads. * os_dep.c (catch_exception_raise): Remove redundant parentheses; refine the documentation.
* 2011-01-07 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-90/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * .cvsignore: Add more auto-generated files. * include/private/.cvsignore: Ditto. * darwin_stop_world.c (GC_mach_handler_thread, GC_use_mach_handler_thread, GC_darwin_register_mach_handler_thread): Define only if MPROTECT_VDB. * darwin_stop_world.c (GC_suspend_thread_list): Use GC_mach_handler_thread and GC_use_mach_handler_thread only if MPROTECT_VDB. * darwin_stop_world.c (GC_stop_world): Reset GC_mach_threads_count only if defined (i.e. unless GC_NO_THREADS_DISCOVERY). * misc.c (GC_init): Fix comment for GWW_VDB. * os_dep.c (GC_mprotect_state_t): Reformat the code. * os_dep.c (DARWIN_EXC_STATE, DARWIN_EXC_STATE_COUNT, DARWIN_EXC_STATE_T, DARWIN_EXC_STATE_DAR): New macros. * os_dep.c (catch_exception_raise): Use DARWIN_EXC_STATE, DARWIN_EXC_STATE_COUNT, DARWIN_EXC_STATE_T, DARWIN_EXC_STATE_DAR; reformat the comment. * pthread_support.c (GC_thr_init): Define "dummy" local variable only unless GC_DARWIN_THREADS; reformat the code. * include/private/gcconfig.h (MPROTECT_VDB): Define for Darwin even in the single-threaded mode; define for iPhone/iPad. * include/private/gcconfig.h (IA64): Remove unnecessary "ifdef" around "undef". * include/private/gcconfig.h (HEURISTIC1): Remove unused for Cygwin. * include/private/gcconfig.h (STACKBOTTOM): Use fixed address for Darwin/arm (instead of HEURISTIC1). * include/private/gcconfig.h (GET_MEM): Reformat the code.
* 2011-01-05 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-243/+227
| | | | | | | | | | | | | | * misc.c (GC_write): Replace multiple "ifdef/endif" with "elif" (for ECOS and NOSYS). * os_dep.c (GC_get_main_stack_base): Ditto. * os_dep.c (GC_get_main_stack_base): Check USE_GET_STACKBASE_FOR_MAIN macro before checking STACKBOTTOM one; remove "dummy" variable (use result one instead); reformat the code. * doc/README.macros (SN_TARGET_PS3): Document. * extra/threadlibs.c (main): Don't output "-lpthread" (and "-ldl") for Android. * include/private/pthread_support.h: Fix comment for "endif".
* 2010-12-26 Ivan Maidanski <ivmai@mail.ru> (mostly really Miguel de Icaza)ivmai2011-07-261-4/+16
| | | | | | | | | | | | | | | | * misc.c (GC_allocate_ml): Define global variable if SN_TARGET_PS3. * misc.c (GC_init): Initialize GC_allocate_ml if SN_TARGET_PS3. * os_dep.c (SIGSEGV): Define to dummy zero if SN_TARGET_PS3. * os_dep.c (GC_unix_mmap_get_mem): Don't define if SN_TARGET_PS3. * os_dep.c (GC_default_push_other_roots, GC_push_thread_structures): Define for SN_TARGET_PS3. * include/private/gc_locks.h (GC_allocate_ml, LOCK, UNLOCK): Define for SN_TARGET_PS3. * include/private/gcconfig.h (SN_TARGET_PS3): Recognize new macro (Sony PS/3 target). * include/private/gcconfig.h (THREADS): Define unconditionally if SN_TARGET_PS3. * include/private/gcconfig.h (GET_MEM): Define for SN_TARGET_PS3.
* 2010-12-02 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-54/+91
| | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2010-10-22 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * CMakeLists.txt: Check enable_parallel_mark on Darwin. * configure.ac: Ditto. * darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS, DARWIN_QUERY_TASK_THREADS): Rename to GC_NO_THREADS_DISCOVERY and GC_DISCOVER_TASK_THREADS, respectively. * os_dep.c (DARWIN_SUSPEND_GC_THREADS): Ditto. * pthread_support.c (DARWIN_SUSPEND_GC_THREADS): Ditto. * darwin_stop_world.c (DARWIN_QUERY_TASK_THREADS): Don't define (and remove FIXME). * darwin_stop_world.c (GC_use_threads_discovery): Add GC_API; comment; remove FIXME. * win32_threads.c (GC_NO_DLLMAIN): Rename to GC_NO_THREADS_DISCOVERY. * tests/test.c (GC_NO_DLLMAIN): Ditto. * doc/README.macros (GC_NO_DLLMAIN): Ditto. * doc/README.win32 (GC_NO_DLLMAIN): Ditto. * doc/README.macros (GC_NO_THREADS_DISCOVERY): Update the comment. * win32_threads.c (GC_win32_dll_threads): Define as macro to true if GC_DISCOVER_TASK_THREADS (and not GC_NO_THREADS_DISCOVERY); update the comment. * win32_threads.c (GC_use_DllMain): Rename to GC_use_threads_discovery; do not set GC_win32_dll_threads if GC_DISCOVER_TASK_THREADS. * win32_threads.c (GC_started_thread_while_stopped, GC_lookup_thread_inner, UNPROTECT_THREAD, GC_lookup_pthread, GC_thr_init, GC_pthread_create, DllMain): Rewrite some expressions which use GC_win32_dll_threads to minimize the possibility of an "unreachable code" compiler warning when GC_win32_dll_threads is defined as a macro. * win32_threads.c (GC_unregister_my_thread): Don't call GC_delete_thread() if GC_win32_dll_threads and THREAD_LOCAL_ALLOC (since can't happen); use "t" local variable only if not GC_win32_dll_threads. * win32_threads.c (GC_register_my_thread_inner): Reformat the comment. * doc/README.macros (GC_DISCOVER_TASK_THREADS): Document. * include/gc.h (GC_use_DllMain): Rename to GC_use_threads_discovery but keep old name as a macro definition. * include/gc.h (GC_use_threads_discovery): Declare also for Darwin; update the comment. * tests/test.c (main): Call GC_use_threads_discovery for Darwin (to test the mode if possible). * configure: Regenerate.
* 2010-10-16 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS, DARWIN_QUERY_TASK_THREADS): New macro recognized. * darwin_stop_world.c (GC_query_task_threads): add STATIC; initialize to false; define as macro if DARWIN_SUSPEND_GC_THREADS or DARWIN_QUERY_TASK_THREADS; remove FIXME. * darwin_stop_world.c (GC_use_threads_discovery): New function (for setting GC_query_task_threads value). * darwin_stop_world.c (GC_mach_handler_thread, GC_use_mach_handler_thread, GC_mach_thread, GC_MAX_MACH_THREADS, GC_mach_threads, GC_mach_threads_count, GC_suspend_thread_list, GC_darwin_register_mach_handler_thread): Define only if not DARWIN_SUSPEND_GC_THREADS. * darwin_stop_world.c (GC_stop_world, GC_start_world): Exclude the code for GC_query_task_threads case from compilation unless DARWIN_SUSPEND_GC_THREADS. * os_dep.c (GC_darwin_register_mach_handler_thread): Declared only if Darwin threads and not DARWIN_SUSPEND_GC_THREADS. * os_dep.c (GC_mprotect_thread): Call GC_darwin_register_mach_handler_thread only if THREADS and not DARWIN_SUSPEND_GC_THREADS. * pthread_support.c (marker_mach_threads): Don't define if DARWIN_SUSPEND_GC_THREADS. * pthread_support.c (GC_mark_thread): Don't fill in marker_mach_threads if DARWIN_SUSPEND_GC_THREADS. * include/private/gc_locks.h (GC_need_to_lock): Always declare for THREADS case.
* 2010-10-08 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-6/+12
| | | | | | | | | | | * darwin_stop_world.c (GC_thread_resume): New inline function (move code from GC_thread_resume). * darwin_stop_world.c (GC_start_world): Check result of task_threads(); call GC_thread_resume(). * os_dep.c (GC_malloc_heap_l, GC_is_malloc_heap_base): Define only if not CYGWIN32. * os_dep.c (GC_is_heap_base): Call GC_is_malloc_heap_base() only if not CYGWIN32.
* 2010-09-11 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-6/+7
| | | | | | | | | | | | | | | | | * dyn_load.c (DL_ITERATE_PHDR_STRONG): New macro (define for FreeBSD). * dyn_load.c (GC_register_main_static_data): Move the definition above GC_register_dynamic_libraries_dl_iterate_phdr one (FreeBSD case); unconditionally return FALSE if DL_ITERATE_PHDR_STRONG. * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Test GC_register_main_static_data() result (instead of direct testing of dl_iterate_phdr (to prevent a compiler warning). * os_dep.c (CODE_OK): Test si_code also for the value of 2 (FreeBSD case; required for FreeBSD v7+). * os_dep.c (CODE_OK): Properly use parentheses (HPUX case). * include/private/gcconfig.h (DATASTART): Cast etext argument in GC_FreeBSDGetDataStart() call; remove unnecessary "&" (FreeBSD case).
* 2010-08-18 Ivan Maidanski <ivmai@mail.ru> (with help from Andreas Tobler)ivmai2011-07-261-4/+6
| | | | | * os_dep.c (PROTECT, UNPROTECT): Correct VM_PROT_EXEC to VM_PROT_EXECUTE.
* 2010-08-14 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-5/+11
| | | | | | | | | | | | * os_dep.c (os2_alloc): Don't set PAG_EXECUTE unless pages_executable is on. * os_dep.c (os2_alloc): Add FIXME (for recursion). * os_dep.c (UNPROTECT): Abort with a more informative message if pages_executable is on ("mprotect" case). * os_dep.c (PROTECT, UNPROTECT): Set VM_PROT_EXEC if pages_executable is on (Darwin case). * pthread_support.c (GC_init_real_syms): Abort with an informative message if libgc is linked after libpthread.
* 2010-08-14 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-2/+0
| | | | | | | * extra/threadlibs.c (main): Remove --wrap for "read" (since not wrapped anymore). * doc/README.linux (GC_USE_LD_WRAP): Ditto. * os_dep.c (__wrap_read): Ditto (in the comment).
* 2010-07-28 Ivan Maidanski <ivmai@mail.ru> (mostly really Noah Lavine)ivmai2011-07-261-23/+63
| | | | | | | | | | | | | | | | | | | | | | * configure.ac (NO_EXECUTE_PERMISSION): Add comment. * doc/README.macros (NO_EXECUTE_PERMISSION): Update the documentation. * include/gc.h (GC_set_pages_executable, GC_get_pages_executable): New API function declaration. * include/gc.h (GC_ignore_warn_proc): Reformat the comment. * os_dep.c (OPT_PROT_EXEC): Remove (superseded by pages_executable). * os_dep.c (pages_executable): New static variable. * os_dep.c (IGNORE_PAGES_EXECUTABLE): New macro (used by GC_get_pages_executable only). * os_dep.c (GC_unix_mmap_get_mem, GC_remap, PROTECT, UNPROTECT): Replace OPT_PROT_EXEC with pages_executable. * os_dep.c (GC_unix_mmap_get_mem, GC_remap, GC_win32_get_mem, GC_wince_get_mem, UNPROTECT): Undefine IGNORE_PAGES_EXECUTABLE. * os_dep.c (GC_win32_get_mem, GC_wince_get_mem, GC_remap, PROTECT, UNPROTECT): Use PAGE_EXECUTE_... only if pages_executable is on. * os_dep.c (GC_set_pages_executable, GC_get_pages_executable): New API function definition.
* 2010-04-16 Ivan Maidanski <ivmai@mail.ru> (mostly really Louis Zhuang)ivmai2011-07-261-1/+65
| | | | | | | * os_dep.c (GC_get_stack_base, GC_get_main_stack_base): New Solaris-specific implementation (based on thr_stksegment). * os_dep.c (stackbase_main_self, stackbase_main_ss_sp): New static variable used by the Solaris-specific GC_get_stack_base().
* 2010-03-19 Ivan Maidanski <ivmai@mail.ru> (really Dave Korn)ivmai2011-07-261-17/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dyn_load.c (GC_get_next_stack, GC_cond_add_roots): Define for Cygwin as well as other win32 targets. * dyn_load.c (GC_wnt): Define to constant true. * dyn_load.c (GC_register_dynamic_libraries): Define for Cygwin as well as other win32 targets. * mark_rts.c (rt_hash, GC_roots_present, add_roots_to_index): Don't define for Cygwin, as on other win32. * mark_rts.c (GC_add_roots_inner, GC_clear_roots): Handle on Cygwin as for other win32 targets. * mark_rts.c (GC_rebuild_root_index): Don't declare on Cygwin, as other win32. * mark_rts.c (GC_remove_tmp_roots): Do declare on Cygwin as on other win32. * mark_rts.c (GC_remove_roots, GC_remove_roots_inner): Don't declare on Cygwin as on other win32. * mark_rts.c (GC_is_tmp_root): Do declare on Cygwin when !NO_DEBUGGING, as on other win32 targets. * mark_rts.c (GC_cond_register_dynamic_libraries): Handle on Cygwin as for other win32 targets. * os_dep.c (GC_setpagesize): Handle on Cygwin as on other win32. * os_dep.c (GC_get_main_stack_base): Don't declare on Cygwin, as other win32. * os_dep.c (GC_sysinfo): Declare on Cygwin, as other win32. * os_dep.c (GC_win32_get_mem): Declare on Cygwin, as on other Win32, but call GC_unix_get_mem instead of GlobalAlloc. * os_dep.c (GC_win32_free_heap): Declare on Cygwin (as empty). * ptr_chck.c (GC_is_visible): Register dynamic libraries on Cygwin as on other win32 platforms. * win32_threads.c (GC_get_next_stack): Define on Cygwin as well as for dynamic loading targets. * include/private/gc_priv.h (GC_INNER): Don't try to use visibility on Cygwin which does not support it. * include/private/gc_priv.h (struct roots): Don't declare r_next member on Cygwin as on other windows hosts. * include/private/gc_priv.h (LOG_RT_SIZE, RT_SIZE): Don't define likewise. * include/private/gc_priv.h (struct _GC_arrays): Do declare _heap_bases[] member and don't declare _root_index likewise. * include/private/gc_priv.h (GC_heap_bases): Do define likewise. * include/private/gc_priv.h (_SYSTEM_INFO): Do forward-declare likewise. * include/private/gc_priv.h (GC_sysinfo): Do declare extern likewise. * include/private/gcconfig.h (GC_win32_get_mem, GET_MEM): Do prototype on Cygwin as other win32 platforms.
* 2010-03-13 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-3/+16
| | | | | | * os_dep.c (GC_get_main_stack_base): Use pthread_getattr_np() and pthread_attr_getstack() instead of GC_get_stack_base() (and check returned stackaddr for NULL); output a warning on failure.
* 2010-03-12 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-0/+7
| | | | | | | * doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Document. * os_dep.c (GC_get_main_stack_base): Recognize USE_GET_STACKBASE_FOR_MAIN (only if THREADS and LINUX_STACKBOTTOM) and use GC_get_stack_base() in this case.
* 2010-03-05 Ivan Maidanski <ivmai@mail.ru> (really Burkhard Linke)ivmai2011-07-261-1/+5
| | | | | | * os_dep.c (GC_get_stack_base): Add LOCK/UNLOCK() (since GC_find_limit_with_bound() should be called with the lock held). * backgraph.c (FOR_EACH_PRED): Fix a typo.
* 2010-03-05 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | * alloc.c (GC_set_stop_func, GC_get_stop_func): Add DCL_LOCK_STATE. * finalize.c (GC_notify_or_invoke_finalizers): Ditto. * gc_dlopen.c (disable_gc_for_dlopen): Ditto. * gcj_mlc.c (maybe_finalize, GC_debug_gcj_malloc): Ditto. * mark.c (GC_print_trace): Ditto. * misc.c (GC_set_warn_proc, GC_get_warn_proc, GC_enable, GC_disable, GC_new_free_list, GC_new_kind, GC_new_proc, GC_set_oom_fn, GC_get_oom_fn, GC_set_finalizer_notifier, GC_get_finalizer_notifier): Ditto. * os_dep.c (GC_get_stack_base, GC_print_callers): Ditto. * pthread_support.c (GC_is_thread_tsd_valid, GC_wait_for_gc_completion, GC_init_parallel, GC_do_blocking_inner, GC_call_with_gc_active, GC_unregister_my_thread, pthread_join, pthread_detach, GC_register_my_thread, GC_inner_start_routine, pthread_create): Ditto. * reclaim.c (GC_print_all_errors): Ditto. * win32_threads.c (GC_is_thread_tsd_valid, GC_register_my_thread, GC_unregister_my_thread, GC_do_blocking_inner, GC_call_with_gc_active, GC_lookup_pthread, GC_pthread_join, GC_pthread_start_inner, GC_thread_exit_proc, GC_pthread_detach, GC_init_parallel): Ditto.
* 2009-12-08 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-19/+32
| | | | | | | | | | | | | | | | | | | | | | | * 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-12-07 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/README.macros (GC_READ_ENV_FILE): Document (new macro). * include/private/gc_priv.h (GETENV): Recognize GC_READ_ENV_FILE; declare and use GC_envfile_getenv(). * misc.c (GC_envfile_content, GC_envfile_length): New static variable (only if GC_READ_ENV_FILE). * misc.c (GC_ENVFILE_MAXLEN): New macro (used in GC_envfile_init). * misc.c (GC_envfile_init, GC_envfile_getenv): New function (only if GC_READ_ENV_FILE). * misc.c (GC_init): Call GC_envfile_init() (before using GETENV) if GC_READ_ENV_FILE. * misc.c (GC_init): Move GC_setpagesize() and GC_init_win32() calls to be just before GC_envfile_init() one (since the latter uses GET_MEM). * misc.c (GC_abort): use ExitProcess() (instead of DebugBreak) for WinCE if NO_DEBUGGING; add a comment for DebugBreak() (for WinCE). * mark_rts.c (GC_add_roots_inner): Remove redundant trailing '\n' from the ABORT message. * misc.c (GC_init): Ditto. * os_dep.c (GC_get_main_stack_base, GC_register_data_segments): Ditto. * pthread_stop_world.c (GC_push_all_stacks): Ditto. * pthread_support.c (GC_init_real_syms, start_mark_threads): Ditto.
* 2009-11-09 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-12/+7
| | | | | | | | * os_dep.c (SIZE_T, PULONG_PTR): Remove. * os_dep.c (ULONG_PTR): Replace with GC_ULONG_PTR (defined as GC "word"); add the comment. * os_dep.c (GetWriteWatch_type, detect_GetWriteWatch, GC_gww_read_dirty): Prefix ULONG_PTR with "GC_".
* 2009-11-06 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+3
| | | | | | | | | | | | | * 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-11-05 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-0/+2
| | | | | | | | | | | * win32_threads.c (GC_please_stop): If DllMain-based thread registration is not compiled in then define GC_please_stop as a non-volatile variable for assertion only. * win32_threads.c (GC_stop_world): Set and clear only if defined. * win32_threads.c (GC_stop_world): Add the comment for GC_printf() usage (while holding GC_write_cs). * win32_threads.c (GC_delete_gc_thread): Ditto. * os_depc.c (GC_remove_protection): Ditto.
* 2009-11-05 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+1
| | | | | | | | * dyn_load.c (GC_dump_meminfo): Prefix "%lx" printf type specifier with "0x". * os_dep.c (PROTECT): Ditto. * win32_threads.c (GC_mark_thread_local_free_lists): Cast p->id to int (to match printf type specifier).
* 2009-11-02 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-11/+7
| | | | * os_dep.c (brk): Rename to ecos_gc_brk.
* 2009-10-23 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-2/+2
| | | | | | | | | | | | | * darwin_stop_world.c (GC_darwin_register_mach_handler_thread): Use GC_INNER for the function definition. * include/private/darwin_stop_world.h (GC_darwin_register_mach_handler_thread): Remove the prototype. * include/private/darwin_stop_world.h: Add copyright header. * os_dep.c (GC_darwin_register_mach_handler_thread): Use GC_INNER for the function prototype. * include/private/gc_priv.h (NDEBUG): Explicitly define if NO_DEBUGGING and not GC_ASSERTIONS (before the standard headers inclusion).
* 2009-10-22 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-56/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-22 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-77/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alloc.c (GC_collection_in_progress): Move the prototype to gc_priv.h. * gc_dlopen.c (GC_collection_in_progress): Ditto. * pthread_support.c (GC_collection_in_progress): Ditto. * misc.c (GC_init_parallel): Ditto. * pthread_support.c (GC_init_parallel): Ditto. * win32_threads.c (GC_init_parallel): Ditto. * darwin_stop_world.c (GC_thr_init): Ditto. * misc.c (GC_thr_init): Ditto. * pthread_stop_world.c (GC_thr_init): Ditto. * pthread_support.c (GC_thr_init): Ditto. * blacklst.c (GC_clear_bl, GC_copy_bl, GC_number_stack_black_listed): Make STATIC. * dbg_mlc.c (GC_print_obj, GC_make_closure, GC_debug_invoke_finalizer): Ditto. * malloc.c (GC_alloc_large_and_clear): Ditto. * mark.c (GC_push_selected, GC_push_marked1, GC_push_marked2, GC_push_marked4, GC_push_marked, GC_push_next_marked, GC_push_next_marked_dirty, GC_push_next_marked_uncollectable): Ditto. * misc.c (GC_clear_stack_inner): Ditto. * os_dep.c (GC_repeat_read, GC_default_push_other_roots): Ditto. * darwin_stop_world.c (FindTopOfStack): Make static; define only if not DARWIN_DONT_PARSE_STACK. * dbg_mlc.c (GC_debug_free_inner): Define only if DBG_HDRS_ALL. * dyn_load.c (GC_repeat_read): Remove unused prototype. * include/private/gc_pmark.h (GC_find_start): Ditto. * misc.c (GC_read, GC_register_finalizer_no_order): Ditto. * dyn_load.c (GC_segment_is_thread_stack): Add prototype (only if THREADS). * dyn_load.c (GC_register_main_static_data): Define only if DYNAMIC_LOADING. * finalize.c (GC_enqueue_all_finalizers): Remove unnecessary tail "return" statement. * gc_dlopen.c (GC_SOLARIS_THREADS): Don't recognize (since implies GC_PTHREADS). * include/gc.h: Fix a typo. * include/gc_inline.h (GC_ASSERT): Define (if not defined) since the header is public. * include/gc_inline.h (GC_generic_malloc_many): New public function declaration. * mallocx.c (GC_generic_malloc_many): Make public. * include/private/gc_priv.h (GC_INNER): Use visibility attribute (if available). * include/private/gc_priv.h (GC_EXTERN): Define using GC_INNER. * include/private/gc_priv.h: Include atomic_ops.h if THREADS and MPROTECT_VDB. * os_dep.c: Don't include atomic_ops.h * win32_threads.c: Ditto. * include/private/gc_priv.h (GC_push_selected, GC_push_regs, GC_push_marked, GC_number_stack_black_listed, GC_alloc_large_and_clear, GC_reclaim_or_delete_all, GC_generic_malloc_many, GC_make_closure, GC_debug_invoke_finalizer, GC_print_obj, GC_page_was_ever_dirty): Remove the prototype. * mark.c (GC_page_was_ever_dirty): Add prototype (only if PROC_VDB). * include/private/gc_priv.h (GC_push_next_marked_dirty, GC_push_next_marked, GC_push_next_marked_uncollectable): Move the prototype to mark.c. * include/private/gc_priv.h (GC_is_static_root): Declare only if not THREADS. * include/private/gc_priv.h (GC_free_inner): Declare only if THREADS. * include/private/gc_priv.h (GC_debug_free_inner): Declare only if THREADS and DBG_HDRS_ALL. * include/private/gc_priv.h (GC_markers): Declare GC_markers only if PARALLEL_MARK. * include/private/gc_priv.h (GC_register_main_static_data): Move the prototype to misc.c. * mach_dep.c (GC_push_regs): Make STATIC; define only along with HAVE_PUSH_REGS definition. * mach_dep.c (GC_clear_stack_inner): Replace K&R-style function definition with the ANSI C one. * mark.c (GC_started_thread_while_stopped): Declared only if not GNU C. * win32_threads.c (GC_started_thread_while_stopped): Don't define if GNU C. * mark.c (GC_mark_from): Avoid unbalanced brackets in #if-#else-#endif blocks. * mark_rts.c (GC_is_static_root): Define only if not THREADS. * os_dep.c (GC_get_stack_base): Make public (for OpenBSD). * os_dep.c (GC_page_was_ever_dirty): Comment out the function except for PROC_VDB. * tests/test.c (main): Don't reference GC_print_obj, GC_make_closure, GC_debug_invoke_finalizer, GC_page_was_ever_dirty, GC_is_fresh (in GC_noop). * thread_local_alloc.c: Don't include "gc_inline.h". * win32_threads.c (GC_write_fault_handler): Declare only if MPROTECT_VDB.
* 2009-10-21 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-60/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-20 Ivan Maidanski <ivmai@mail.ru> (really mostly OpenBSD contributors)ivmai2011-07-261-8/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (openbsd): Define GC_OPENBSD_THREADS. * configure.ac: Add AM_CONDITIONAL(OPENBSD_THREADS). * configure.ac: Add sparc-openbsd case. * doc/README.macros (GC_NETBSD_THREADS, GC_OPENBSD_THREADS): Document. * tests/test.c (main): Handle OpenBSD case. * extra/threadlibs.c: Add the copyright header; expand all tabs to spaces; remove trailing spaces at EOLn. * include/private/pthread_stop_world.h: Ditto. * extra/threadlibs.c (main): Replace K&R-style function definition with the ANSI C one. * extra/threadlibs.c (main): Handle GC_OPENBSD_THREADS case. * dyn_load.c (OPENBSD): Recognize (similar to NETBSD). * include/gc_config_macros.h (GC_SOLARIS_THREADS): Recognize; define it for OpenBSD. * include/gc_pthread_redirects.h (GC_pthread_sigmask, pthread_sigmask): Don't declare and redefine for OpenBSD. * include/private/gcconfig.h: Handle OpenBSD (on arm, sh, i386, amd64, powerpc). * mach_dep.c (NO_GETCONTEXT): Ditto. * include/private/pthread_stop_world.h (thread_stop_info): Don't define last_stop_count field if OpenBSD. * misc.c (GC_init_dyld): Add declaration (if NetBSD). * misc.c (GC_init): Don't call GC_init_netbsd_elf() for OpenBSD. * os_dep.c (GC_init_netbsd_elf): Don't define for OpenBSD. * os_dep.c (old_segv_act, GC_jmp_buf_openbsd): New static variable (only if OpenBSD). * os_dep.c (GC_fault_handler_openbsd, GC_find_limit_openbsd, GC_skip_hole_openbsd): New static function (only if OpenBSD). * os_dep.c (GC_get_stack_base, GC_get_main_stack_base, GC_register_data_segments): Define specially for OpenBSD case. * os_dep.c (GC_fault_handler_lock): Initialize to AO_TS_INITIALIZER (instead of 0). * pthread_support.c (GC_allocate_lock): Ditto. * pthread_stop_world.c (NSIG, GC_print_sig_mask, GC_remove_allowed_signals, suspend_handler_mask, GC_stop_count, GC_world_is_stopped, GC_retry_signals, SIG_THR_RESTART, GC_suspend_ack_sem, GC_suspend_handler_inner, GC_suspend_handler, GC_restart_handler): Don't define and use if OpenBSD. * pthread_stop_world.c (GC_suspend_all, GC_stop_world, GC_start_world): Handle OpenBSD case. * pthread_stop_world.c (GC_stop_init): Define as empty if OpenBSD. * pthread_support.c (pthread_sigmask): Don't undefine the macro and don't define the wrapper function if OpenBSD. * pthread_support.c (GC_thr_init): Handle OpenBSD case. * configure: Regenerate. * include/private/config.h.in: Ditto.
* 2009-10-19 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-6/+13
| | | | | | | | | | | | | | | | | | | * gc_dlopen.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Define if dlopen redirection is turned off; turn it on later when dlopen real symbol is no longer needed (according to the comment and the same as in dyn_load.c). * gc_dlopen.c (WRAP_FUNC, REAL_FUNC): Rename to WRAP_DLFUNC and REAL_DLFUNC, respectively (to have unique names since the definitions may differ from that of the similar ones in pthread_support.c). * mark.c (source): Undefine the macro when no longer needed. * os_dep.c (handler): Rename the type to GC_fault_handler_t (to have the unique name across the project). * os_dep.c (STAT_BUF_SIZE, STAT_READ); Guard with ifndef; add the comment. * pthread_support.c (STAT_BUF_SIZE, STAT_READ): Ditto. * os_dep.c (sbrk): Undo sbrk() redirection (for ECOS) when no longer needed.
* 2009-10-17 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-23/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alloc.c (GC_copyright): Define as const. * alloc.c (GC_collect_at_heapsize): Replace "static" with "STATIC" (since the name starts with "GC_" prefix). * dbg_mlc.c (GC_describe_type_fns): Ditto. * dyn_load.c (GC_FirstDLOpenedLinkMap, GC_register_dynlib_callback, GC_dyld_sections, GC_dyld_name_for_hdr, GC_dyld_image_add, GC_dyld_image_remove): Ditto. * malloc.c (GC_libpthread_start, GC_libpthread_end, GC_libld_start, GC_libld_end): Ditto. * mark_rts.c (GC_remove_root_at_pos, GC_rebuild_root_index): Ditto. * os_dep.c (GC_gww_read_dirty, GC_gww_page_was_dirty, GC_gww_page_was_ever_dirty, GC_mprotect_thread_notify, GC_mprotect_thread_reply, GC_mprotect_thread, GC_darwin_sigbus, GC_forward_exception): Ditto. * pthread_support.c (GC_syms_initialized): Ditto. * typd_mlc.c (GC_push_typed_structures_proc): Ditto. * win32_threads.c (GC_win32_dll_threads, GC_register_my_thread_inner, GC_lookup_pthread, GC_get_stack_min, GC_waitForSingleObjectInfinite): Ditto. * darwin_stop_world.c (GC_use_mach_handler_thread, GC_use_mach_handler_thread, GC_mach_threads_count): Replace "static" with "STATIC" and add zero initializer. * os_dep.c (GC_task_self, GC_ports, GC_mprotect_state, GC_sigbus_count): Ditto. * headers.c (free_hdr): Replace "static" with GC_INLINE. * misc.c (GC_tmp): Rename static variable to fwrite_gc_res. * os_dep.c (memory): Rename static variable to ecos_gc_memory. * os_dep.c (async_set_pht_entry_from_index): Make static (for MPROTECT_VDB case). * pthread_support.c (GC_real_pthread_create, GC_real_pthread_sigmask, GC_real_pthread_join, GC_real_pthread_detach, GC_init_real_syms): Use REAL_FUNC() macro for static GC_real_XXX symbols. * win32_threads.c (GC_may_be_in_stack): Remove "GC_" prefix.
* 2009-10-17 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | * 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-16 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+1
| | | | | | | | | | | * alloc.c (GC_finish_collection): Replace getenv() with GETENV(). * dyn_load.c (GC_init_dyld): Ditto. * os_dep.c (GC_print_callers): Ditto. * dyn_load.c (GC_dyld_name_for_hdr): Cast _dyld_get_image_name() result (since it's always of "struct mach_header" type). * dyn_load.c (GC_init_dyld): Cast GC_dyld_image_add and GC_dyld_image_remove (to always have the first argument of "struct mach_header" pointer type).
* 2009-10-01 Ivan Maidanski <ivmai@mail.ru> (really mostly Andreas Tobler)ivmai2011-07-261-2/+3
| | | | | | | | | | | | | | | | | | | | | * 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-10-01 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+32
| | | | | | | | | | | | | | | | | | | | | | * dyn_load.c (GC_register_dynamic_libraries): Always use lpMaximumApplicationAddress value for WinCE (even for old versions). * os_dep.c (VER_PLATFORM_WIN32_CE): Define if not in winbase.h. * os_dep.c (GC_dont_query_stack_min): New global variable (only if WinCE and THREADS). * os_dep.c (GC_setpagesize): Adjust lpMaximumApplicationAddress for WinCE (prior to version 6) if not _WIN32_WCE_EMULATION; set GC_dont_query_stack_min for older WinCE (prior to version 5). * win32_threads.c (GC_dont_query_stack_min): Declare. * win32_threads.c (GC_get_stack_min): Rename the macro to GC_wince_evaluate_stack_min for WinCE; update the comment. * win32_threads.c (GC_push_stack_for, GC_get_next_stack): Use GC_wince_evaluate_stack_min() instead of GC_get_stack_min() for WinCE and don't update thread's last_stack_min value (only if GC_dont_query_stack_min). * win32_threads.c (GC_push_stack_for): Skip assertion for WinCE if GC_dont_query_stack_min (since the evaluated stack_min value may be incorrect if the stack is bigger than 64 KiB).
* 2009-09-30 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-1/+1
| | | | | | | | | | * Makefile.direct: Remove trailing spaces at EOLn. * Makefile.direct: Document GC_REGISTER_MEM_PRIVATE. * mark_rts.c (GC_is_tmp_root): Define also for WinCE unless NO_DEBUGGING (that is, replace _WIN32_WCE_EMULATION with MSWINCE). * os_dep.c (GC_sysinfo): Remove explicit global variable initialization to "{0}" (revert back the previous change) since it might produce a warning.
* 2009-09-30 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-35/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-30 Ivan Maidanski <ivmai@mail.ru> (really Hans Boehm)ivmai2011-07-261-2/+2
| | | | * os_dep.c (PROTECT, UNPROTECT): Use distinct ABORT messages.
* 2009-09-27 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-261-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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".