summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Workaround 'x might be clobbered by longjmp' g++ warning in setjmp_tIvan Maidanski2020-02-251-1/+5
| | | | | | | (fix of commits e59ed5784, 90331999b) * tools/setjmp_t.c [!CPPCHECK && __cplusplus] (a_str): Define as a macro.
* Fix 'conversion from string constant to char*' warning in setjmp_t.cIvan Maidanski2020-02-211-1/+1
| | | | | | (fix of commit e59ed5784) * tools/setjmp_t.c (a_str): Change type from char* to const char*.
* Workaround 'condition x==2 is always false' cppcheck FP in setjmp_tIvan Maidanski2020-02-151-1/+3
| | | | | | | | Computation of x local variable (stored in a register) in setjmp_t.c is more disguised now. * tools/setjmp_t.c (a_str): New global variable (initialized to "a"). * tools/setjmp_t.c (main): Pass a_str (instead of "a") to strlen().
* Collapse multiple includes of windows.hIvan Maidanski2019-09-141-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | (code refactoring) * dyn_load.c [MSWIN32 || MSWINCE || CYGWIN32]: Do not define WIN32_LEAN_AND_MEAN and NOSERVICE macros; do not include windows.h. * include/private/gc_locks.h [GC_WIN32_THREADS && !USE_PTHREAD_LOCKS]: Likewise. * include/private/gc_priv.h [!NO_CLOCK && !BSD_TIME && (MSWIN32 || MSWINCE || WINXP_USE_PERF_COUNTER)]: Likewise. * include/private/thread_local_alloc.h [!USE_PTHREAD_SPECIFIC && !USE_COMPILER_TLS && !USE_WIN32_COMPILER_TLS && USE_WIN32_SPECIFIC]: Likewise. * mallocx.c [MSWINCE]: Likewise. * misc.c [MSWIN32 || MSWINCE || CYGWIN32 && GC_READ_ENV_FILE]: Likewise. * os_dep.c [MSWIN32 || MSWINCE || CYGWIN32]: Likewise. * tests/test.c [MSWIN32 || MSWINCE]: Likewise. * tools/setjmp_t.c [!OS2 && (MSWIN32 || MSWINCE || CYGWIN32)]: Likewise. * win32_threads.c [GC_WIN32_THREADS]: Likewise. * include/private/gc_priv.h [MSWIN32 || MSWINCE || CYGWIN32] (WIN32_LEAN_AND_MEAN, NOSERVICE): Define macro (before include windows.h). * include/private/gc_priv.h [MSWIN32 || MSWINCE || CYGWIN32]: Inclde windows.h and winbase.h before include gc_locks.h (instead of just before GC_sysinfo declaration).
* Consistently define WIN32_LEAN_AND_MEAN/NOSERVICE before include windows.hIvan Maidanski2018-06-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | (code refactoring) Note: these macros are not (and should not be) defined in the public headers (gc.h). * cord/tests/de.c [WIN32] (WIN32_LEAN_AND_MEAN, NOSERVICE): Define macro before include windows.h. * cord/tests/de_win.c (WIN32_LEAN_AND_MEAN, NOSERVICE): Likewise. * extra/msvc_dbg.c (WIN32_LEAN_AND_MEAN, NOSERVICE): Likewise. * tests/initsecondarythread.c [!GC_PTHREADS] (WIN32_LEAN_AND_MEAN, NOSERVICE): Likewise. * tests/subthread_create.c [!GC_PTHREADS] (WIN32_LEAN_AND_MEAN, NOSERVICE): Likewise. * tests/test.c [MSWIN32 || MSWINCE] (WIN32_LEAN_AND_MEAN, NOSERVICE): Likewise. * tests/test_cpp.cc [MSWIN32] (WIN32_LEAN_AND_MEAN, NOSERVICE): Likewise. * tests/thread_leak_test.c [!GC_PTHREADS] (WIN32_LEAN_AND_MEAN, NOSERVICE): Likewise. * tools/setjmp_t.c [MSWIN32 || MSWINCE || CYGWIN32] (WIN32_LEAN_AND_MEAN, NOSERVICE): Likewise. * cord/tests/de_win.c: Replace include "windows.h" to include <windows.h>.
* Workaround 'function nested_sp is never used' cppcheck style warningIvan Maidanski2018-05-151-0/+3
| | | | | | | | The warning should not be produced by cppcheck as nested_sp is assigned to nested_sp_fn variable. * tools/setjmp_t.c [CPPCHECK] (main): Call nested_sp() directly; add comment.
* Convert GC source files to valid C++ codeIvan Maidanski2018-02-162-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #206 (bdwgc). * alloc.c (GC_copyright): Change type from char* const to const char* const. * alloc.c (GC_set_fl_marks, GC_clear_fl_marks, GC_finish_collection, GC_allocobj): Add missing explicit casts from void* to ptr_t. * backgraph.c [MAKE_BACK_GRAPH] (add_back_edges): Likewise. * blacklst.c (GC_default_print_heap_obj_proc, GC_print_blacklisted_ptr): Likewise. * dbg_mlc.c (GC_get_back_ptr_info, GC_store_debug_info_inner, GC_store_debug_info, GC_debug_malloc, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_generic_malloc, GC_debug_malloc_stubborn, GC_debug_malloc_atomic, GC_debug_malloc_uncollectable, GC_debug_malloc_atomic_uncollectable, GC_debug_free, GC_debug_free_inner, GC_debug_register_finalizer, GC_debug_register_finalizer_no_order, GC_debug_register_finalizer_unreachable, GC_debug_register_finalizer_ignore_self): Likewise. * finalize.c (GC_grow_table, push_and_mark_object, ensure_toggleref_capacity, GC_dump_finalization_links, GC_dump_finalization, GC_make_disappearing_links_disappear, GC_remove_dangling_disappearing_links, GC_finalize): Likewise. * gcj_mlc.c (GC_gcj_malloc, GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise. * include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Likewise. * mallocx.c (GC_memalign): Likewise. * mark.c (GC_mark_from, GC_mark_and_push, GC_push_all_eager, GC_push_all_stack, GC_push_marked1, GC_push_marked2, GC_push_marked4): Likewise. * mark_rts.c (GC_exclude_static_roots_inner): Likewise. * misc.c (GC_base): Likewise. * new_hblk.c (GC_new_hblk): Likewise. * pthread_support.c (GC_register_altstack, GC_thr_init, GC_record_stack_base): Likewise. * ptr_chck.c (GC_is_visible): Likewise. * reclaim.c (GC_reclaim_small_nonempty_block, GC_disclaim_and_reclaim_or_free_small_block): Likewise. * thread_local_alloc.c (GC_mark_thread_local_fls_for): Likewise. * typd_mlc.c (GC_typed_mark_proc, GC_malloc_explicitly_typed_ignore_off_page): Likewise. * win32_threads.c (GC_record_stack_base, GC_get_stack_min, GC_push_stack_for): Likewise. * blacklst.c (GC_copy_bl): Rename "new" argument to "dest". * dbg_mlc.c (GC_store_debug_info_inner, GC_print_smashed_obj): Change type of p argument from ptr_t to void*. * include/private/gc_priv.h (GC_is_heap_base, GC_is_static_root): Likewise. * mark_rts.c [!THREADS] (GC_is_static_root): Likewise. * os_dep.c (GC_is_malloc_heap_base, GC_is_heap_base): Likewise. * ptr_chck.c (GC_on_stack): Likewise. * dbg_mlc.c (GC_print_obj): Change type of kind_str local variable from char* to const char*. * dbg_mlc.c (GC_debug_strdup, GC_debug_strndup): Cast result of GC_debug_malloc_atomic() to char*. * mallocx.c (GC_strdup, GC_strndup): Likewise. * dbg_mlc.c (GC_debug_wcsdup): Cast result of GC_debug_malloc_atomic() to wchar_t*. * mallocx.c (GC_wcsdup): Likewise. * dyn_load.c [MSWIN32 || MSWINCE || CYGWIN32] (GC_register_dynamic_libraries): Cast p local variable to char*. * os_dep.c (GC_register_data_segments): Likewise. * fnlz_mlc.c [ENABLE_DISCLAIM] (GC_finalized_disclaim): Cast masked fc_word to struct GC_finalizer_closure* (instead of void*). * fnlz_mlc.c [ENABLE_DISCLAIM] (GC_finalized_malloc): Cast result of GC_malloc_kind() to word*. * typd_mlc.c (GC_malloc_explicitly_typed, GC_calloc_explicitly_typed): Likewise. * include/private/gc_priv.h (WARN): Cast away const qualifier for msg (and the string literal). * misc.c (GC_default_on_abort): Remove cast to void* for WRITE() buf argument. * misc.c (GC_new_free_list_inner): Cast result local variable to void**. * misc.c (GC_new_free_list): Change type of result local variable from void* to void**. * pthread_support.c (GC_start_rtn_prepare_thread): Cast arg to struct start_info*. * win32_threads.c [GC_PTHREADS] (GC_pthread_start_inner): Likewise. * reclaim.c (GC_print_free_list): Replace ptr_t flh to void *flh_next local variable; remove redundant casts. * tools/if_mach.c (EXECV_ARGV_T): New macro; add comment. * tools/if_not_there.c (EXECV_ARGV_T): Likewise. * tools/if_mach.c (main): Use EXECV_ARGV_T instead of void* for execvp() argument. * tools/if_not_there.c (main): Likewise. * typd_mlc.c (LeafDescriptor, ComplexArrayDescriptor, SequenceDescriptor): Move struct definition out of union ComplexDescriptor. * typd_mlc.c (GC_add_ext_descriptor): Rename "new" local variable to newExtD. * win32_threads.c (GC_CreateThread, GC_beginthreadex): Cast result of GC_malloc_uncollectable() to thread_args*. * win32_threads.c [PARALLEL_MARK && !MSWINCE && __cplusplus] (GC_thr_init): Do not cast GetProcessAffinityMask() arguments to void*.
* Fix 'anonymous type with no linkage used to declare variable' C++ errorIvan Maidanski2018-02-091-1/+1
| | | | | | | | | (fix of commit 8086c72) Issue #201 (bdwgc). * tests/test.c (A): Give some name to struct. * tools/setjmp_t.c (a): Likewise.
* Run command passed to if_not_there directly from Makefile.directIvan Maidanski2018-01-241-3/+9
| | | | | | | | | | | | | | | | Issue #199 (bdwgc). if_not_there tool is modified to accept a single argument (file name). * Makefile.direct (base_lib, cords, test_cpp, c++, mach_dep.o, mark_rts.o, cord/cordtest, cord/de, gctest): Replace "if_not_there <file> <command>" with "if_not_there <file> || <command>". * Makefile.direct (c++): Add dependency on $(UTILS). * Makefile.direct (gctest): Remove double spaces. * tools/if_not_there.c: Update header comment. * tools/if_not_there.c (main): Allow both 2 and 3 command-line arguments; return 2 if the file does not exist and argc is 2; update the printed usage message.
* Use HOST_ANDROID define instead of PLATFORM_ANDROIDZoltan Varga2018-01-241-1/+1
| | | | | | | | | | | | | | | | (a cherry-pick of commit 5d819c8 from 'mono_libgc') * doc/README.macros (PLATFORM_ANDROID): Rename to HOST_ANDROID. * dyn_load.c: Rename PLATFORM_ANDROID to HOST_ANDROID. * include/gc.h: Likewise. * include/gc_config_macros.h: Likewise. * include/private/gcconfig.h: Likewise. * include/private/thread_local_alloc.h: Likewise. * os_dep.c: Likewise. * pthread_support.c: Likewise. * tests/initsecondarythread.c: Likewise. * tests/test.c: Likewise. * tools/threadlibs.c: Likewise.
* Fix missing EOLn output in threadlibs toolIvan Maidanski2018-01-181-1/+1
| | | | * tools/threadlibs.c [GC_OSF1_THREADS] (main): Print "\n" after "-lrt".
* Fix threadlibs tool to output '-lpthread' for DragonFlyIvan Maidanski2018-01-171-3/+3
| | | | | | * tools/threadlibs.c [GC_FREEBSD_THREADS && (__DragonFly__ || !__FREEBSD_version)] (main): Print "-lpthread" (as well as for __FREEBSD_version >= 500000).
* Remove 'dist' target from Makefile.directIvan Maidanski2017-05-122-22/+0
| | | | | | | | | | | | | | Distribution tarballs are now created using autotools-based Makefile. * Makefile.am (EXTRA_DIST): Remove tools/add_gc_prefix.c, tools/gcname.c items. * Makefile.direct (SRCS): Likewise. * Makefile.direct (DOC_FILES, TESTS, GNU_BUILD_FILES, OTHER_MAKEFILES, OTHER_FILES): Remove variable. * Makefile.direct (add_gc_prefix, gcname, dist, gc.tar, gc.tar.Z, gc.tar.gz): Remove target. * tools/add_gc_prefix.c: Remove. * tools/gcname.c: Likewise.
* Remove GC_GNU_THREADS macro (HURD)Ivan Maidanski2017-05-031-1/+1
| | | | | | | | | | | | | | | | (code refactoring) * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && *-*-gnu*] (GC_GNU_THREADS): Define GC_THREADS macro instead. * configure.ac [THREADS=posix && *-*-gnu*] (GC_GNU_THREADS): Likewise. * configure.ac (GC_GNU_THREADS): Remove AH_TEMPLATE. * include/gc_config_macros.h: Remove check for GC_GNU_THREADS. * include/private/gcconfig.h [!CPPCHECK]: Remove consistency check for GC_GNU_THREADS. * pthread_support.c [GC_PTHREADS && !GC_WIN32_THREADS] (GC_get_nprocs): Replace GC_GNU_THREADS to HURD macro check. * tools/threadlibs.c (main): Replace GC_GNU_THREADS to HURD and GC_THREADS macros check.
* Use sigsetjmp() in setjmp_t tool if availableIvan Maidanski2017-03-231-3/+3
| | | | | | * tools/setjmp_t.c (main): Replace jmp_buf, setjmp(), longjmp() to JMP_BUF, SETJMP(), LONGJMP(), respectively; cast result of SETJMP() to void type.
* Fix tools/setjmp_t hang (OS X)Ivan Maidanski2017-03-231-1/+1
| | | | | * tools/setjmp_t.c (main): Declare "y" static variable as volatile (to prevent reordering/optimization of y++).
* Remove notes that K&R C compiler is unsupportedIvan Maidanski2017-03-101-1/+0
| | | | | | | | | | * README.QUICK: Remove a note that ANSI C compiler is required/assumed (not a K&R C compiler). * doc/README.cords: Likewise. * doc/README.macros (GC_GCJ_SUPPORT): Likewise. * include/gc_backptr.h: Likewise. * pcr_interface.c [PCR]: Likewise. * tools/if_not_there.c: Likewise.
* Define CLANG/GNUC_PREREQ macros to check gcc/clang minimum versionIvan Maidanski2017-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (code refactoring) * cord/cordxtra.c (CORD_ATTR_UNUSED): Use GC_GNUC_PREREQ() instead of direct use of __GNUC[_MINOR]__. * gc_cpp.cc (GC_NEW_DELETE_NEED_THROW): Likewise. * include/gc_config_macros.h (GC_API, GC_ATTR_MALLOC, GC_ATTR_ALLOC_SIZE, GC_ATTR_NONNULL, GC_ATTR_DEPRECATED, GC_RETURN_ADDR, GC_RETURN_ADDR_PARENT, GC_PTHREAD_EXIT_ATTRIBUTE): Likewise. * include/gc_cpp.h (GC_NO_OPERATOR_NEW_ARRAY): Likewise. * include/gc_inline.h (GC_EXPECT, GC_PREFETCH_FOR_WRITE): Likewise. * include/new_gc_alloc.h: Likewise. * include/private/gc_priv.h (GC_INNER, GC_ATTR_UNUSED, EXPECT, GC_INLINE, GC_ATTR_NOINLINE, GC_API_OSCALL, GC_ATTR_FORMAT_PRINTF, NONNULL_ARG_NOT_NULL): Likewise. * include/private/gc_priv.h [CANCEL_SAFE] (GC_cancel_disable_count): Likewise. * include/private/gcconfig.h (HAVE_BUILTIN_UNWIND_INIT, PREFETCH, GC_PREFETCH_FOR_WRITE): Likewise. * include/private/gcconfig.h [I386 && LINUX && __ELF__] (GC_NO_SIGSETJMP): Likewise. * include/private/gcconfig.h [X86_64 && MSWIN32] (MPROTECT_VDB): Likewise. * include/private/thread_local_alloc.h [CYGWIN32] (USE_PTHREAD_SPECIFIC): Likewise. * include/private/thread_local_alloc.h [LINUX && !ARM32 && !AVR32 || PLATFORM_ANDROID && !__clang__] (USE_COMPILER_TLS): Likewise. * mark.c [MSWIN32 || MSWINCE] (GC_mark_some): Likewise. * mark_rts.c (GC_approx_sp): Likewise. * tests/test_cpp.cc (ATTR_UNUSED): Likewise. * tools/setjmp_t.c (nested_sp): Likewise. * include/gc_config_macros.h (GC_GNUC_PREREQ): New macro (not for public use). * include/private/gc_priv.h (GC_CLANG_PREREQ): New private macro. * include/private/gcconfig.h (HAVE_BUILTIN_UNWIND_INIT): Refine comment. * include/private/thread_local_alloc.h [LINUX && !ARM32 && !AVR32 || PLATFORM_ANDROID && !__clang__] (USE_COMPILER_TLS): Use GC_CLANG_PREREQ() instead of direct use of __clang_major__ and __clang_minor__. * mark.c [MSWIN32 || MSWINCE] (GC_mark_some): Likewise.
* Fix various typos in comments and printed messagesKlemens Zwischenbrugger2017-02-211-1/+1
| | | | | | | | | | | | | | | | This patch contains some spelling fixes (just in comments and C strings passed to printf) as found by bot (https://github.com/ka7/misspell_fixer). * SMakefile.amiga: Fix typo in comment ("don't"). * WCC_MAKEFILE (SYSTEM): Fix typo in comment ("uncomment"). * configure.ac [!GCC] (gc_cflags): Fix typo in comment ("actually"). * configure.ac (NO_CLOCK): Fix typo in comment ("targeting"). * doc/README.amiga: Fix typos in documentation ("there's", "compliant", "documentation"). * extra/AmigaOS.c [GC_AMIGA_PRINTSTATS] (GC_amiga_free_all_mem): Fix typos in printed messages ("succeeded", "succeeding"). * include/gc.h (GC_get_heap_size): Fix typo in comment ("below"). * tools/setjmp_t.c (main): Fix typo in printed message ("won't").
* Fix 'execvp argument incompatible pointer type' compiler warning (tools)Ivan Maidanski2017-01-102-2/+2
| | | | | | | * tools/if_mach.c (main): Cast the 2nd argument of execvp to void* (to avoid compiler warning as the argument of execvp() prototype could be of "const char* const*" or "char**" type). * tools/if_not_there.c (main): Likewise.
* Suppress 'tainted string passed to vulnerable operation' false defectsIvan Maidanski2016-11-152-5/+8
| | | | | | | | | | | | * include/private/gc_priv.h (TRUSTED_STRING): New tagging macro; add comment. * misc.c (GC_init): Process the result of GETENV("GC_LOG_FILE") by TRUSTED_STRING. * tools/if_mach.c (main): Process argv[3] by TRUSTED_STRING (before passing the string to execvp). * tools/if_not_there.c (main): Declare "fname" local variable; process argv[1] and argv[2] by TRUSTED_STRING (before passing the strings to fopen/opendir and execvp, respectively).
* Eliminate 'printf format specifier mismatch' compiler warning (tools)Ivan Maidanski2016-10-131-1/+1
| | | | | * tools/setjmp_t.c (main): Use %lu (instead of %ld) printf format specifier for unsigned long value.
* Workaround 'resource leak' error reported by cppcheck (tools, test)Ivan Maidanski2016-10-131-2/+8
| | | | | | | * tests/test.c [GC_GCJ_SUPPORT && TEST_WITH_SYSTEM_MALLOC] (reverse): Call GC_noop1 for malloc() result. * tools/if_not_there.c (main): Move "f" local variable assignments outside conditional expression.
* Eliminate 'unnecessary comparison of static strings' cppcheck warningIvan Maidanski2016-10-131-1/+1
| | | | * tools/if_mach.c (main): Replace strcmp(x, "")!=0 with strlen(x)>0.
* Eliminate 'address of local variable returned' static analyzer warningIvan Maidanski2016-10-051-0/+4
| | | | | | | | * mark_rts.c [__GNUC__ >= 4] (GC_approx_sp): Use __builtin_frame_address(0) instead of &sp (but still write the value to the volatile local variable to force stack to grow if necessary). * tools/setjmp_t.c [__GNUC__ >= 4] (nested_sp): Return __builtin_frame_address(0) instead of sp.
* Fix tools/setjmp_t to prevent nested_sp inliningIvan Maidanski2016-10-051-3/+6
| | | | | | | | | | Inlined nested_sp might cause incorrect result of nested_sp()<sp. * tools/setjmp_t.c (nested_sp): Change return from int* to word. * tools/setjmp_t.c (nested_sp_fn): New global volatile variable initialized to nested_sp. * tools/setjmp_t.c (main): Use nested_sp_fn instead of nested_sp; remove redundant cast.
* Eliminate 'value stored is never read' warning of Clang static analyzerIvan Maidanski2016-08-261-0/+3
| | | | | | * tools/setjmp_t.c (g): Declare (before "main"). * tools/setjmp_t.c (main): Call g(x) to use "x" variable value after x=2.
* Fix 'signed-to-bigger-unsigned value assignment' warning in GC_setpagesizeIvan Maidanski2016-02-171-1/+1
| | | | | | | * include/private/gcconfig.h (GETPAGESIZE): Cast getpagesize() and sysconf() result to unsigned int. * tools/setjmp_t.c (main): Change type of "ps" local variable from long to unsigned int.
* Bump version to 7.4.0; change policy regarding version numbersgc7_4_0Ivan Maidanski2013-11-172-20/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | * ChangeLog: Update. * README.md: Bump version. * configure.ac (AC_INIT): Likewise. * include/gc_version.h (GC_TMP_VERSION_MINOR): Likewise. * alloc.c (GC_version, GC_get_version): Replace GC_TMP_ALPHA_VERSION with GC_VERSION_MICRO. * doc/debugging.html: Remove comment about "alpha" versions. * doc/overview.html: Likewise. * include/gc.h (GC_get_version): Update comment. * include/gc_version.h (GC_NOT_ALPHA): Remove. * include/gc_version.h (GC_TMP_ALPHA_VERSION): Replace with GC_TMP_VERSION_MICRO; add comment about policy. * m4/gc_set_version.m4 (GC_ALPHA_VERSION): Replace with GC_VERSION_MICRO; update comments; adjust version format test. * tests/test.c (GC_ALPHA_VERSION): Remove. * tools/add_gc_prefix.c (GC_ALPHA_VERSION): Likewise. * tools/gcname.c (GC_ALPHA_VERSION): Likewise. * tests/test.c (CHECH_GCLIB_VERSION): Replace GC_ALPHA_VERSION with GC_VERSION_MICRO. * tools/add_gc_prefix.c (main): Replace "gc%d.%d[alpha%d]" print format with "gc-%d.%d.%d" one. * tools/gcname.c (main): Likewise. * windows-untested/gc.ver (_BETA, GC_VERSION_MICRO): Remove.
* Fix all address-of-dummy operations by using GC_approx_sp() insteadIvan Maidanski2012-08-011-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (previous commit 'd6acbda' has not solved this problem) * alloc.c (min_bytes_allocd, GC_stopped_mark): Use GC_approx_sp() instead of "&dummy"; remove 'dummy' local variable. * dyn_load.c (GC_cond_add_roots): Likewise. * misc.c (GC_init): Likewise. * os_dep.c (GC_get_stack_base, GC_get_main_stack_base): Likewise. * pthread_stop_world.c (GC_suspend_handler_inner, nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Likewise. * pthread_support.c (GC_thr_init): Likewise. * ptr_chck.c (GC_on_stack): Likewise. * win32_threads.c (GC_push_stack_for): Likewise. * misc.c (GC_clear_stack_inner): Store address of volatile 'dummy' local array (i.e. 'sp' value) to its first element (and use it in the comparison of addresses) to prevent any harmful optimizations as C officially disallows comparisons of pointers to different objects (e.g., some Mac OS X clang releases might turn a conditional expression that uses 'dummy' address into a constant); update comment. * misc.c (GC_call_with_stack_base): Use "&base" instead of "&dummy" (it is safe to use address of base here); remove dummy variable. * os_dep.c (currently_updating): Change type from "word" to "int*". * os_dep.c (async_set_pht_entry_from_index): Remove volatile and casts for 'update_dummy' local variable. * tools/setjmp_t.c (main): Define volatile 'sp' local variable, store its address to it and use it instead of "&dummy"; remove 'dummy' local variable.
* Resolve GCC warning in setjmp_t.cIvan Maidanski2012-08-011-6/+6
| | | | | | | | * tools/setjmp_t.c (nested_sp): Change 'sp' local variable type from int to word (to avoid 'cast from pointer to int' compiler warning). * tools/setjmp_t.c (main): Cast pointers to unsigned long via word type; cast WORDSZ value passed to printf() to match format type specifier (to avoid compiler warnings).
* Fix all address-of-dummy operations by adding volatileIvan Maidanski2012-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alloc.c (min_bytes_allocd, GC_stopped_mark): Use volatile for 'dummy' local variable (used to get 'sp' value) to prevent any harmful optimizations (e.g., some Mac OS X clang releases might turn a conditional expression that uses 'dummy' address into a constant). * dyn_load.c (GC_cond_add_roots): Likewise. * mach_dep.c (GC_with_callee_saves_pushed): Likewise. * misc.c (GC_clear_stack_inner, GC_init, GC_call_with_stack_base): Likewise. * os_dep.c (GC_get_stack_base, GC_get_main_stack_base, async_set_pht_entry_from_index): Likewise. * pthread_stop_world.c (nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Likewise. * pthread_support.c (GC_thr_init): Likewise. * ptr_chck.c (GC_on_stack): Likewise. * tools/setjmp_t.c (main): Likewise. * win32_threads.c (GC_push_stack_for): Likewise. * dyn_load.c (dummy): Change variable type from char to int. * include/private/gcconfig.h: Update comment about GC_stackbottom initialization. * os_dep.c (GC_get_stack_base): Remove 'sp' local variable. * os_dep.c (GC_get_main_stack_base): Define and use volatile 'dummy' variable (instead of 'result') to get 'sp' value (revert part of commit bddc75f). * os_dep.c (GC_get_stack_base): Add missing cast of 'dummy' address (only if NEED_FIND_LIMIT). * pthread_stop_world.c (GC_suspend_handler_inner): Define and use volatile 'dummy' variable (instead of 'me') to get 'sp' value (revert part of commit 31fc0f6). * pthread_stop_world.c (nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Rename 'local_dummy' to 'dummy' local variable.
* tools: Include proper header file for configuration macrosIvan Maidanski2012-06-163-4/+4
| | | | | | | | * tools/if_mach.c: Include private/gc_priv.h instead of private/gcconfig.h (to get proper configuration macros defined). * tools/if_not_there.c: Likewise. * tools/threadlibs.c: Likewise. * tools/threadlibs.c: Do not include gc_config_macros.h directly.
* Fix GC_ALPHA_VERSION comparison in gctest and tools filesIvan Maidanski2012-03-192-0/+8
| | | | | | | * tests/test.c (GC_ALPHA_VERSION): Define to GC_TMP_ALPHA_VERSION if not defined by gc_version.h. * tools/add_gc_prefix.c (GC_ALPHA_VERSION): Likewise. * tools/gcname.c (GC_ALPHA_VERSION): Likewise.
* Replace pointer relational comparisons with non-pointer onesIvan Maidanski2012-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* tools: Prevent compiler warnings regarding unused argument and printfIvan Maidanski2012-02-293-8/+16
| | | | | | | | | | | | * tools/if_mach.c (main): Remove unused "envp" argument. * tools/if_not_there.c (main): Likewise. * tools/if_mach.c: Expand tabs to spaces. * tools/if_not_there.c: Likewise. * tools/setjmp_t.c (getpagesize): Define for Win32; include windows.h. * tools/setjmp_t.c (main): Make printf() format specifier string non-empty (to suppress compiler warning). * tools/setjmp_t.c (main): Adjust printf() format specifier for WORDSZ value (unsigned long instead of int).
* tools: Change some functions declaration style from K-R to ANSI CIvan Maidanski2012-02-292-11/+8
| | | | | | | * tools/add_gc_prefix.c (main): Remove unused "envp" argument. * tools/add_gc_prefix.c (main): Replace the K&R-style function definition with the ANSI C one. * tools/gcname.c (main): Likewise.
* Remove trailing spaces at EOLn in all filesIvan Maidanski2011-12-223-6/+4
|
* Move and rename "callprocs" utility to tools/callprocs.sh.Ivan Maidanski2011-09-141-0/+4
| | | | | | | | | | | | | * callprocs: Move/rename to tools/callprocs.sh. * Makefile.am (dist_noinst_SCRIPTS): Remove. * Makefile.am (EXTRA_DIST): Add tools/callprocs.sh (move from dist_noinst_SCRIPTS). * Makefile.direct (OTHER_FILES): Rename callprocs to tools/callprocs.sh. * Makefile.dj (OTHER_FILES): Likewise. * README: Likewise. * doc/leak.html: Likewise. * README: Fix a typo.
* Move build tools sources from "extra" to "tools" folder.Ivan Maidanski2011-08-256-0/+315
* EMX_MAKEFILE (setjmp_test): Move setjmp_t.c to "tools" folder. * Makefile.am (EXTRA_DIST): Move add_gc_prefix.c, gcname.c, if_mach.c, if_not_there.c, setjmp_t.c and threadlibs.c to "tools" folder. * Makefile.direct (SRCS, OTHER_FILES, if_mach, threadlibs, if_not_there, setjmp_test, add_gc_prefix, gcname): Ditto. * Makefile.dj (SRCS, OTHER_FILES, if_mach, threadlibs, if_not_there, setjmp_test, add_gc_prefix): Ditto. * PCR-Makefile (if_mach, if_not_there): Ditto. * SMakefile.amiga (setjmp_t): Ditto. * doc/simple_example.html: Change folder name for threadlibs.c file. * EMX_MAKEFILE: Remove trailing spaces at EOLn. * SMakefile.amiga: Ditto.