platform/upstream/libgc.git
7 years agoFix SIGSEGV in GC_is_marked when gc_cleanup is used in leak-finding mode
Ivan Maidanski [Fri, 14 Jul 2017 08:11:13 +0000 (11:11 +0300)]
Fix SIGSEGV in GC_is_marked when gc_cleanup is used in leak-finding mode

Issue #162 (bdwgc).

Now finalizers and disappearing links registration is a no-op in case
of the leak-finding mode.

*  finalize.c (GC_register_disappearing_link_inner): Do nothing (return
GC_UNIMPLEMENTED) if GC_find_leak.
* finalize.c (GC_register_finalizer_inner): Do nothing if GC_find_leak.
* include/gc.h (GC_find_leak): More verbose comment.
* include/gc.h (GC_debug_register_finalizer,
GC_general_register_disappearing_link): Document the case of
GC_find_leak.

7 years agoFix atomic_ops build in Makefile.direct for Solaris
Ivan Maidanski [Thu, 13 Jul 2017 20:27:15 +0000 (23:27 +0300)]
Fix atomic_ops build in Makefile.direct for Solaris

* Makefile.direct (atomic_ops.o, atomic_ops_sysdeps.o): Expand "$<"
macro manually; add comment.

7 years agoRemove name of optional arguments of operator new and new[] in gc_cpp.h
Ivan Maidanski [Thu, 13 Jul 2017 20:17:39 +0000 (23:17 +0300)]
Remove name of optional arguments of operator new and new[] in gc_cpp.h
(code refactoring)

* include/gc_cpp.h (operator new): Comment out cleanup and clientData
argument names.
* include/gc_cpp.h [GC_OPERATOR_NEW_ARRAY] (operator new[]): Likewise.

7 years agoFix push_complex_descriptor to avoid unlimited global mark stack growth
Ivan Maidanski [Tue, 11 Jul 2017 23:04:30 +0000 (02:04 +0300)]
Fix push_complex_descriptor to avoid unlimited global mark stack growth

Global mark stack should not grow in parallel marker mode (as
fixed-size local_mark_stack is used instead).

* typd_mlc.c [PARALLEL_MARK] (GC_array_mark_proc): Do not set
GC_mark_stack_too_small if GC_parallel (and new_mark_stack_ptr is
null); add comment.

7 years agoFix deadlock in GC_suspend_thread when thread is finished
Ivan Maidanski [Tue, 11 Jul 2017 22:10:42 +0000 (01:10 +0300)]
Fix deadlock in GC_suspend_thread when thread is finished
(fix commits 62097c3, 59e2bcf)

* pthread_stop_world.c [GC_ENABLE_SUSPEND_THREAD] (GC_suspend_thread):
Do not call RAISE_SIGNAL() and sem_wait() if thread has FINISHED flag
set; do not handle ESRCH error result of RAISE_SIGNAL(); add comment.

7 years ago.gitignore: Ignore .log and .trs files for test_atomic_ops
Ivan Maidanski [Tue, 11 Jul 2017 21:39:41 +0000 (00:39 +0300)]
.gitignore: Ignore .log  and .trs files for test_atomic_ops

7 years agoTravis CI: Workaround 'real_malloc is never called' cppcheck warning
Ivan Maidanski [Mon, 10 Jul 2017 21:49:14 +0000 (00:49 +0300)]
Travis CI: Workaround 'real_malloc is never called' cppcheck warning
(fix commit 0027759)

7 years agoWorkaround 'GCC_ATOMIC_TEST_AND_SET_TRUEVAL unknown' cppcheck info message
Ivan Maidanski [Mon, 10 Jul 2017 21:41:53 +0000 (00:41 +0300)]
Workaround 'GCC_ATOMIC_TEST_AND_SET_TRUEVAL unknown' cppcheck info message
(fix commit 46a2411)

* include/private/gc_atomic_ops.h [__GCC_ATOMIC_TEST_AND_SET_TRUEVAL]
(AO_TS_SET): Do not use __GCC_ATOMIC_TEST_AND_SET_TRUEVAL if CPPCHECK.

7 years agoUpdate ChangeLog file
Ivan Maidanski [Sat, 8 Jul 2017 18:52:57 +0000 (21:52 +0300)]
Update ChangeLog file

7 years agoUpdate ChangeLog file (v7.6 changes only)
Ivan Maidanski [Sat, 8 Jul 2017 18:35:48 +0000 (21:35 +0300)]
Update ChangeLog file (v7.6 changes only)

7 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Sat, 8 Jul 2017 18:03:00 +0000 (21:03 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

7 years agoTravis CI: Change --with-checksums to --enable-checksums in CONF_OPTIONS
Ivan Maidanski [Thu, 6 Jul 2017 17:18:02 +0000 (20:18 +0300)]
Travis CI: Change --with-checksums to --enable-checksums in CONF_OPTIONS

7 years agoRename with_checksums to enable_checksums option in CMake script
Ivan Maidanski [Thu, 6 Jul 2017 17:25:29 +0000 (20:25 +0300)]
Rename with_checksums to enable_checksums option in CMake script
(refactoring of commit 4530166)

* CMakeLists.txt (with_checksums): Rename to enable_checksums.

7 years agoChange configure --with-checksums to --enable-checksums option
Ivan Maidanski [Thu, 6 Jul 2017 17:11:09 +0000 (20:11 +0300)]
Change configure --with-checksums to --enable-checksums option
(refactoring of commit bfd8345)

* configure.ac (checksums): Replace AC_ARG_WITH with AC_ARG_ENABLE;
update AS_HELP_STRING accordingly.
* configure.ac (with_checksums): Replace with enable_checksums.

7 years agowindows-untested: Do not build checksums.c
Ivan Maidanski [Thu, 29 Jun 2017 18:31:09 +0000 (21:31 +0300)]
windows-untested: Do not build checksums.c

7 years agoTravis CI: Test --disable-munmap
Ivan Maidanski [Thu, 29 Jun 2017 18:23:10 +0000 (21:23 +0300)]
Travis CI: Test --disable-munmap

7 years agoFix configure --disable-munmap handling
Ivan Maidanski [Thu, 29 Jun 2017 18:19:33 +0000 (21:19 +0300)]
Fix configure --disable-munmap handling
(fix commits d564f15, bfd8345)

* configure.ac (USE_MUNMAP, MUNMAP_THRESHOLD): Do not define if
enable_munmap is "no" (or a blank value).
* configure.ac [with_checksums=yes]: Do not report AC_MSG_ERROR if
enable_munmap is "no".

7 years agoCall WARN() if GC_mprotect_dirty_init cannot succeed (Darwin)
Ivan Maidanski [Thu, 29 Jun 2017 09:38:06 +0000 (12:38 +0300)]
Call WARN() if GC_mprotect_dirty_init cannot succeed (Darwin)
(fix commit 6bfc840)

* os_dep.c [MPROTECT_VDB && DARWIN && CAN_HANDLE_FORK]
(GC_mprotect_dirty_init): Replace GC_COND_LOG_PRINTF() with WARN()
which is called before return FALSE; refine WARN message.

7 years agoTravis CI: Test --enable-munmap with OS X
Ivan Maidanski [Thu, 29 Jun 2017 09:01:40 +0000 (12:01 +0300)]
Travis CI: Test --enable-munmap with OS X

7 years agoTravis CI: Test --enable-handle-fork
Ivan Maidanski [Thu, 29 Jun 2017 08:56:12 +0000 (11:56 +0300)]
Travis CI: Test --enable-handle-fork

7 years agoDecide between memory unmapping and mprotect-based dirty bits at runtime
Ivan Maidanski [Thu, 29 Jun 2017 07:47:50 +0000 (10:47 +0300)]
Decide between memory unmapping and mprotect-based dirty bits at runtime

* allchblk.c [USE_MUNMAP && MPROTECT_VDB] (GC_has_unmapped_memory): New
function.
* include/private/gcconfig.h [USE_MUNMAP] (MPROTECT_VDB): Do not
undefine unless GWW_VDB; update comment.
* os_dep.c [MPROTECT_VDB && USE_MUNMAP] (GC_has_unmapped_memory,
GC_mprotect_dirty_init): Declare function.
* os_dep.c [MPROTECT_VDB && USE_MUNMAP] (GC_dirty_init): Ensure
mprotect-based virtual dirty bits and memory unmapping are not both
turned on (disable on of them and call WARN with the appropriate
message), and call GC_mprotect_dirty_init (unless memory unmapping is
requested or some pages are already unmapped).
* os_dep.c [MPROTECT_VDB && !USE_MUNMAP] (GC_mprotect_dirty_init):
Define as a macro (to GC_dirty_init).
* os_dep.c [MPROTECT_VDB] (GC_dirty_init): Rename to
GC_mprotect_dirty_init.

7 years agoFix gctest crash if configure --enable-handle-fork on Darwin
Ivan Maidanski [Wed, 28 Jun 2017 22:04:35 +0000 (01:04 +0300)]
Fix gctest crash if configure --enable-handle-fork on Darwin
(fix commit a7817bc)

* include/private/gc_priv.h [!GC_DISABLE_INCREMENTAL] (GC_incremental):
Refine comment.
* include/private/gc_priv.h [!GC_DISABLE_INCREMENTAL]
(GC_dirty_maintained): Remove variable declaration.
* include/private/gc_priv.h [!GC_DISABLE_INCREMENTAL] (GC_dirty_init):
Change return type from void to GC_bool; update comment.
* mark.c [!GC_DISABLE_INCREMENTAL || CHECKSUMS] (GC_initiate_gc):
Replace GC_dirty_maintained with GC_incremental.
* mark.c [!GC_DISABLE_INCREMENTAL && PROC_VDB] (GC_push_conditional):
Likewise.
* mark.c [!GC_DISABLE_INCREMENTAL] (GC_push_next_marked_dirty): Likewise.
* misc.c [!GC_DISABLE_INCREMENTAL && !KEEP_BACK_PTRS]
(GC_enable_incremental): Likewise.
* os_dep.c [MPROTECT_VDB] (GC_remove_protection): Likewise.
* pthread_support.c [CAN_HANDLE_FORK && GC_DARWIN_THREADS
&& MPROTECT_VDB] (GC_atfork_prepare): Likewise.
* win32_threads.c [MPROTECT_VDB] (UNPROTECT_THREAD): Likewise.
* misc.c [!GC_DISABLE_INCREMENTAL] (GC_init): Set GC_incremental value
to the result of GC_dirty_init().
* misc.c [!GC_DISABLE_INCREMENTAL && !KEEP_BACK_PTRS]
(GC_enable_incremental): Likewise.
* misc.c [!GC_DISABLE_INCREMENTAL && !KEEP_BACK_PTRS]
(GC_enable_incremental): Set GC_incremental to true just before GC_init
call (to indicate the intention to turn on GC incremental mode).
* os_dep.c [!GC_DISABLE_INCREMENTAL] (GC_dirty_maintained): Remove
global variable.
* os_dep.c [GWW_VDB && !MPROTECT_VDB] (GC_gww_dirty_init): Define macro
to GC_dirty_init.
* os_dep.c [GWW_VDB && !MPROTECT_VDB] (GC_dirty_init): Remove function.
* os_dep.c [DEFAULT_VDB || MANUAL_VDB || MPROTECT_VDB || PCR_VDB]
(GC_dirty_init): Change return type to GC_bool; return true; remove
assignment of GC_dirty_maintained.
* os_dep.c [PROC_VDB] (GC_dirty_init): Replace ABORT with WARN and
return false if "pagedata" file open failed.
* os_dep.c [MPROTECT_VDB && DARWIN] (GC_dirty_init): Return false if
GC_handle_fork; add TODO item to replace ABORT with WARN (and return
false).

7 years agoImply configure --single-obj-compilation if --disable-static
Ivan Maidanski [Tue, 27 Jun 2017 21:33:11 +0000 (00:33 +0300)]
Imply configure --single-obj-compilation if --disable-static

* configure.ac (single-obj-compilation): Set default value to yes
if enable_static=no; update help message.
* configure.ac (single_obj_compilation): Rename variable to
enable_single_obj_compilation.

7 years agoMake GC_INIT optional for clients even if thread-local allocations enabled
Ivan Maidanski [Fri, 23 Jun 2017 11:06:11 +0000 (14:06 +0300)]
Make GC_INIT optional for clients even if thread-local allocations enabled

* tests/test.c (GC_OPT_INIT): Do not define to GC_INIT() even if
THREAD_LOCAL_ALLOC; force define to GC_INIT() if TEST_EXPLICIT_GC_INIT
macro defined.
* thread_local_alloc.c [USE_PTHREAD_SPECIFIC || USE_WIN32_SPECIFIC]
(GC_malloc_kind): Check keys_initialized before GC_getspecific call
(fall back to GC_malloc_kind_global if keys_initialized is false).

7 years agoCheck thread_local is initialized before accessing thread_key
Ivan Maidanski [Fri, 23 Jun 2017 08:18:16 +0000 (11:18 +0300)]
Check thread_local is initialized before accessing thread_key

* thread_local_alloc.c [GC_GCJ_SUPPORT] (GC_gcj_malloc): Move
GC_ASSERT(GC_gcj_malloc_initialized) to be before accessing
GC_thread_key.

7 years agoEnsure GC initialized when atfork_prepare is called by client
Ivan Maidanski [Fri, 23 Jun 2017 06:13:15 +0000 (09:13 +0300)]
Ensure GC initialized when atfork_prepare is called by client

Otherwise, if THREAD_LOCAL_ALLOC, GC_remove_all_threads_but_me would
not find the current thread descriptor in GC_threads.

* pthread_support.c [CAN_HANDLE_FORK] (GC_atfork_prepare): Call GC_init
if not GC_is_initialized.
* win32_threads.c [CAN_HANDLE_FORK] (GC_atfork_prepare): Likewise.

7 years agoTravis CI: Test explicit -D DEFAULT_STACK_MAYBE_SMALL"
Ivan Maidanski [Fri, 23 Jun 2017 05:36:19 +0000 (08:36 +0300)]
Travis CI: Test explicit -D DEFAULT_STACK_MAYBE_SMALL"

7 years agoFix gctest failure if PARALLEL_MARK (musl)
Peter Wang [Thu, 22 Jun 2017 21:25:41 +0000 (00:25 +0300)]
Fix gctest failure if PARALLEL_MARK (musl)

Issue #159 (bdwgc).

The default stack size of threads in musl is not large enough for
GC with parallel markers enabled.  This commit increases the stack
of the created threads to the required minimum.

* include/private/gcconfig.h [PARALLEL_MARK && (HPUX
|| GC_DGUX386_THREADS || NO_GETCONTEXT)] (DEFAULT_STACK_MAYBE_SMALL):
New macro; add TODO item.
* include/private/gcconfig.h [PARALLEL_MARK || THREADS] (MIN_STACK_SIZE):
New macro.
* pthread_support.c (MIN_STACK_SIZE): Do not define.
* pthread_support.c (GC_start_mark_threads_inner): Check
DEFAULT_STACK_MAYBE_SMALL macro instead of HPUX or GC_DGUX386_THREADS.
* pthread_support.c [DEFAULT_STACK_MAYBE_SMALL]
(GC_start_mark_threads_inner): Do not set stack size if old_size is 0.
* pthread_support.c [GC_ASSERTIONS] (WRAP_FUNC(pthread_create)): Use
MIN_STACK_SIZE in GC_ASSERT.
* tests/test.c [GC_PTHREADS && DEFAULT_STACK_MAYBE_SMALL]
(fork_a_thread): Set stack size of the created thread to MIN_STACK_SIZE.
* tests/test.c [GC_PTHREADS] (main): Set size of the created thread
also if DEFAULT_STACK_MAYBE_SMALL is defined.

7 years agoUpdate AUTHORS file
Ivan Maidanski [Wed, 21 Jun 2017 07:25:16 +0000 (10:25 +0300)]
Update AUTHORS file

7 years agoDocument STACK_NOT_SCANNED macro in gcconfig.h (Emscripten)
Jukka Jylanki [Wed, 21 Jun 2017 07:22:04 +0000 (10:22 +0300)]
Document STACK_NOT_SCANNED macro in gcconfig.h (Emscripten)

Issue #163 (bdwgc).

* include/private/gcconfig.h [__EMSCRIPTEN__] (STACK_NOT_SCANNED): Add
comment (explaining the reason of defining this macro).

7 years agoBetter document minimum value of size argument for typed allocations
Ivan Maidanski [Tue, 20 Jun 2017 22:07:12 +0000 (01:07 +0300)]
Better document minimum value of size argument for typed allocations

* include/gc_typed.h (GC_make_descriptor): Provide a better argument
name (in comment).
* include/gc_typed.h (GC_malloc_explicitly_typed,
GC_calloc_explicitly_typed): Explicitly state in comment that the
size of the object in words should not be less than the number of
significant bits in the specified descriptor.

7 years agoAdd minimal testing of GC_set_bit (gctest)
Ivan Maidanski [Tue, 20 Jun 2017 21:42:44 +0000 (00:42 +0300)]
Add minimal testing of GC_set_bit (gctest)

* tests/test.c (typed_test): Initialize bm3, bm2 local variables to zero;
call GC_set_bit to setup bm3 and bm2 (instead of direct hard-coding of
bm3 and bm2 values during their initialization).

7 years agoFix typed_test to prevent fails in malloc_explicitly_typed (64-bit)
Hamayama [Tue, 20 Jun 2017 21:30:24 +0000 (00:30 +0300)]
Fix typed_test to prevent fails in malloc_explicitly_typed (64-bit)

Issue #166 (bdwgc).

* tests/test.c (typed_test): Pass 320*sizeof(word)+some_number instead
of 2000 to GC_malloc_explicitly_typed, so that to satisfy the size
argument requirement of the latter regardless of word size).

7 years agoFix compilation error in get_main_stack_base (Emscripten)
Ivan Maidanski [Tue, 20 Jun 2017 18:22:53 +0000 (21:22 +0300)]
Fix compilation error in get_main_stack_base (Emscripten)

Issue #163 (bdwgc).

* os_dep.c [!BEOS && !AMIGA && !OS2 && !MSWIN32 && !MSWINCE && !CYGWIN32
&& !GC_OPENBSD_THREADS && !STACKBOTTOM && !HEURISTIC1 && !HEURISTIC2
&& !LINUX_STACKBOTTOM && !FREEBSD_STACKBOTTOM] (GC_get_main_stack_base):
Set result to null if STACK_NOT_SCANNED (instead of #error).

7 years agoPrevent abort in register_data_segments for Symbian and Emscripten
Ivan Maidanski [Tue, 20 Jun 2017 14:05:20 +0000 (17:05 +0300)]
Prevent abort in register_data_segments for Symbian and Emscripten

Issue #163 (bdwgc).

DATASTART is tested to have a non-null value in GC_register_data_segments,
so the macro should not be defined to null even if it is not really
used (null value typically means that the corresponding weak symbol
is not resolved).

* include/private/gcconfig.h [SYMBIAN || __EMSCRIPTEN__] (DATASTART,
DATAEND): Change to a non-null value (ALIGNMENT).

7 years agoUpdate AUTHORS file (add Hamayama)
Ivan Maidanski [Tue, 20 Jun 2017 08:58:15 +0000 (11:58 +0300)]
Update AUTHORS file (add Hamayama)

7 years agoFix null dereference in reclaim_block if DONT_ADD_BYTE_AT_END
Hamayama [Tue, 20 Jun 2017 08:56:20 +0000 (11:56 +0300)]
Fix null dereference in reclaim_block if DONT_ADD_BYTE_AT_END

Issue #167 (bdwgc).

* reclaim.c (GC_reclaim_block): If ok->ok_reclaim_list is null then
do not update hhdr->hb_next (and *rlh).

7 years agoFix text formatting in gcinterface.md
Ivan Maidanski [Tue, 20 Jun 2017 07:50:45 +0000 (10:50 +0300)]
Fix text formatting in gcinterface.md
(fix commit 0ac938d)

* doc/gcinterface.md (GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE): Do not break
"void *" with a new line.
* doc/gcinterface.md (C++ Interface, C interface): Use "##" (to
identify section title) instead of "#" (or "**").

7 years agoTravis CI: Add test with -D DONT_ADD_BYTE_AT_END
Ivan Maidanski [Tue, 20 Jun 2017 07:38:35 +0000 (10:38 +0300)]
Travis CI: Add test with -D DONT_ADD_BYTE_AT_END

7 years agoConvert overview.html, tree.html to Markdown format
Ivan Maidanski [Tue, 20 Jun 2017 07:31:44 +0000 (10:31 +0300)]
Convert overview.html, tree.html to Markdown format

* README.md: Replace overview.html with overview.md.
* doc/doc.am (dist_doc_DATA): Likewise.
* doc/doc.am (dist_doc_DATA): Replace tree.html with tree.md.
* doc/gcdescr.md (Mark phase): Likewise.
* doc/overview.html: Change file suffix to .md; convert text format
from HTML to Markdown.
* doc/tree.html: Likewise.

7 years agoConvert gcdescr.html, gcinterface.html to Markdown format
Ivan Maidanski [Fri, 16 Jun 2017 16:00:07 +0000 (19:00 +0300)]
Convert gcdescr.html, gcinterface.html to Markdown format

* README.QUICK: Replace gcinterface.html with gcinterface.md.
* doc/doc.am (dist_doc_DATA): Likewise.
* doc/gc.man: Likewise.
* doc/overview.html: Likewise.
* doc/doc.am (dist_doc_DATA): Replace gcdescr.html with gcdescr.md.
* doc/overview.html: Likewise.
* doc/gcdescr.html: Change file suffix to .md; convert text format
from HTML to Markdown.
* doc/gcinterface.html: Likewise.

7 years agoFix compiler intrinsics support check failure in 'make distcheck'
Ivan Maidanski [Fri, 16 Jun 2017 15:32:05 +0000 (18:32 +0300)]
Fix compiler intrinsics support check failure in 'make distcheck'
(fix commit 4c6be54)

* configure.ac [with_libatomic_ops=check] (CFLAGS): Add
-I${srcdir}/include -I${srcdir}/tests (instead of -Iinclude).
* configure.ac [with_libatomic_ops=check] (AC_TRY_RUN): Do not
specify folder in #include.

7 years agoFix ALL_INTERIOR_POINTERS name in comments and documentation
Ivan Maidanski [Fri, 16 Jun 2017 15:16:07 +0000 (18:16 +0300)]
Fix ALL_INTERIOR_POINTERS name in comments and documentation

* doc/gcdescr.html (Mark phase): Replace ALL_INTERIOR_PTRS with
ALL_INTERIOR_POINTERS.
* doc/tree.html: Likewise.
* include/private/gc_hdrs.h (HC_GET_HDR): Replace GC_all_interior_ptrs
with GC_all_interior_pointers in comment.

7 years agoConsistently use 'msec' instead of 'ms' in comments in pthread_support
Ivan Maidanski [Fri, 16 Jun 2017 14:48:37 +0000 (17:48 +0300)]
Consistently use 'msec' instead of 'ms' in comments in pthread_support

* pthread_support.c [USE_SPIN_LOCK] (GC_lock): Replace "ms" with "msecs"
in comment; put a space between number and "msec" (in comment).

7 years agoUpdate bdwgc mailing list online archive link in documentation
Ivan Maidanski [Fri, 16 Jun 2017 08:24:35 +0000 (11:24 +0300)]
Update bdwgc mailing list online archive link in documentation

* README.md (Feedback, Contribution, Questions and Notifications):
Update information about accessing the mailing list archive (add link
to that at Narkive site).
* doc/overview.html (Contacts and new release announcements): Replace
link to the mailing list archive at Gmane.org to that at Narkive.

7 years agoUpdate GCJ link in documentation
Ivan Maidanski [Fri, 16 Jun 2017 07:45:02 +0000 (10:45 +0300)]
Update GCJ link in documentation

* doc/gcdescr.html: Replace http://gcc.gnu.org/java link (which now
points to GCC itself) with https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcj/
one.
* doc/overview.html: Likewise.

7 years agoDocument GWW_VDB in gcdescr.html
Ivan Maidanski [Fri, 16 Jun 2017 07:39:16 +0000 (10:39 +0300)]
Document GWW_VDB in gcdescr.html

* doc/gcdescr.html (Generational Collection and Dirty Bits): Document
GWW_VDB.

7 years agoTravis CI: Update after changing configure to use atomic intrinsics
Ivan Maidanski [Thu, 15 Jun 2017 09:10:09 +0000 (12:10 +0300)]
Travis CI: Update after changing configure to use atomic intrinsics

7 years agoUse compiler atomic intrinsics by default if available (configure)
Ivan Maidanski [Thu, 15 Jun 2017 08:30:57 +0000 (11:30 +0300)]
Use compiler atomic intrinsics by default if available (configure)

* README.md (Installation and Portability): Update information about
libatomic_ops usage.
* configure.ac [with_libatomic_ops=check]: AC_TRY_RUN(test_atomic_ops.c)
(before PKG_CHECK_MODULES(ATOMIC_OPS)) with -D GC_BUILTIN_ATOMIC
added to CFLAGS; set with_libatomic_ops to none if test_atomic_ops
succeeds (unless cross-compiling).

7 years agoAdd test_atomic_ops to perform minimal testing of used atomic primitives
Ivan Maidanski [Wed, 14 Jun 2017 09:16:00 +0000 (12:16 +0300)]
Add test_atomic_ops to perform minimal testing of used atomic primitives

The main purpose of test_atomic_ops is to be able to check whether
it is safe to use compiler atomic intrinsics (enabled by defining
GC_BUILTIN_ATOMIC macro).

* tests/test_atomic_ops.c: New file.
* tests/tests.am [THREADS] (TESTS, check_PROGRAMS): Add
test_atomic_ops.
* tests/tests.am [THREADS] (test_atomic_ops_SOURCES,
test_atomic_ops_LDADD): New variable.
* tests/tests.am (check-without-test-driver): Run test_atomic_ops (if
available).

7 years ago.gitignore: Ignore test_atomic_ops
Ivan Maidanski [Wed, 14 Jun 2017 07:57:15 +0000 (10:57 +0300)]
.gitignore: Ignore test_atomic_ops

7 years agoTravis CI: Scan pcr_interface.c, real_malloc.c in extra (CSA, cppcheck)
Ivan Maidanski [Tue, 13 Jun 2017 20:57:51 +0000 (23:57 +0300)]
Travis CI: Scan pcr_interface.c, real_malloc.c in extra (CSA, cppcheck)

7 years agoMove pcr_interface.c, real_malloc.c to 'extra' folder
Ivan Maidanski [Tue, 13 Jun 2017 20:41:10 +0000 (23:41 +0300)]
Move pcr_interface.c, real_malloc.c to 'extra' folder
(code refactoring)

* Makefile.am (EXTRA_DIST): Add extra/ prefix to pcr_interface.c,
real_malloc.c.
* PCR-Makefile (CSRC): Likewise.
* PCR-Makefile (COBJ): Add extra/ prefix to pcr_interface.o,
real_malloc.o.
* extra/gc.c: Remove include pcr_interface.c; update comment about
files which are not included.
* pcr_interface.c: Move to "extra" folder.
* real_malloc.c: Likewise.
* include/private/gc_priv.h (GC_INNER, GC_EXTERN): Update comment.

7 years agoUpdate Download information in GC overview document
Ivan Maidanski [Tue, 13 Jun 2017 18:31:52 +0000 (21:31 +0300)]
Update Download information in GC overview document

* doc/overview.html: Change Download page link to that on GitHub; add
BDWGC acronym; remove link to gc.tar.gz; recommend to download
"recent stable" version; remove link to ancient boehm-gc in gcc;
provide link to the list of changes (for each version).

7 years agoTravis CI: Use configure --with-checksums instead of -D CHECKSUMS
Ivan Maidanski [Fri, 9 Jun 2017 16:53:22 +0000 (19:53 +0300)]
Travis CI: Use configure --with-checksums instead of -D CHECKSUMS

7 years agoCompile checksums.c only if --with-checksums is given (configure)
Ivan Maidanski [Fri, 9 Jun 2017 16:42:54 +0000 (19:42 +0300)]
Compile checksums.c only if --with-checksums is given (configure)

New configure option (--with-checksums) is added, mainly to workaround
'checksums.a has no symbols' link warning (observed on Darwin).

* Makefile.am [!SINGLE_GC_OBJ] (libgc_la_SOURCES): Do not add checksums.c
unless CHECKSUMS.
* configure.ac (checksums): New AC_ARG_WITH.
* configure.ac [with_checksums && (enable_munmap || THREADS!=none)]:
Issue AC_MSG_ERROR.
* configure.ac (CHECKSUMS): New AC_DEFINE and AM_CONDITIONAL if
with_checksums.

7 years agoSupport with_checksums option in CMake script
Ivan Maidanski [Fri, 9 Jun 2017 16:05:35 +0000 (19:05 +0300)]
Support with_checksums option in CMake script

* CMakeLists.txt (with_checksums): New option (off by default).
* CMakeLists.txt [with_checksums && enable_threads]: Issue MESSAGE that
the configuration is not supported.
* CMakeLists.txt [with_checksums] (CHECKSUMS): Define macro.
* CMakeLists.txt [with_checksums] (SRC): Add checksums.c.

7 years agoDo not produce .tar.bz2 distribution file (configure)
Ivan Maidanski [Fri, 9 Jun 2017 08:05:00 +0000 (11:05 +0300)]
Do not produce .tar.bz2 distribution file (configure)

* configure.ac (AM_INIT_AUTOMAKE): Remove dist-bzip2.

7 years agoFix non-Linux configure-based builds
Ivan Maidanski [Thu, 8 Jun 2017 10:11:58 +0000 (13:11 +0300)]
Fix non-Linux configure-based builds
(fix commit 8240ed0)

* configure.ac (pthread_start_standalone): New variable.
* configure.ac [*-*-*linux* && THREADS=posix] (pthread_start_standalone):
Set to yes (instead of AM_CONDITIONAL(PTHREAD_START_STANDALONE) directly).
* configure.ac (PTHREAD_START_STANDALONE): AM_CONDITIONAL if
pthread_start_standalone.

7 years agoFix pthread_start compilation if single-obj-compilation (Linux)
Ivan Maidanski [Thu, 8 Jun 2017 08:40:36 +0000 (11:40 +0300)]
Fix pthread_start compilation if single-obj-compilation (Linux)

* Makefile.am [SINGLE_GC_OBJ && PTHREAD_START_STANDALONE] (AM_CPPFLAGS):
Add -DGC_PTHREAD_START_STANDALONE.
* Makefile.am [SINGLE_GC_OBJ && PTHREAD_START_STANDALONE]
(libgc_la_SOURCES): Add pthread_start.c entry.
* Makefile.am: Add bank lines (to improve readability).
* configure.ac [*-*-*linux*]: Add AM_CONDITIONAL(PTHREAD_START_STANDALONE).

7 years agoFix PCR-Makefile by removing compilation of a missing file
Ivan Maidanski [Thu, 8 Jun 2017 08:09:55 +0000 (11:09 +0300)]
Fix PCR-Makefile by removing compilation of a missing file

* PCR-Makefile (COBJ): Remove solaris_threads.o entry.
* PCR-Makefile (CSRC): Remove solaris_threads.c entry.

7 years agoDo not compile pcr_interface.c and real_malloc.c except by PCR-Makefile
Ivan Maidanski [Wed, 7 Jun 2017 22:16:58 +0000 (01:16 +0300)]
Do not compile pcr_interface.c and real_malloc.c except by PCR-Makefile

These .c files are empty compilation units for targets other than PCR.

* Makefile.am (libgc_la_SOURCES): Remove pcr_interface.c, real_malloc.c.
* Makefile.direct (CSRCS): Likewise.
* Makefile.am (EXTRA_DIST): Add pcr_interface.c, real_malloc.c.
* SMakefile.amiga (OBJS): Remove real_malloc.o.
* SMakefile.amiga (real_malloc.o): Remove.

7 years agowindows-untested: Do not build gc_dlopen/pcr_interface/real_malloc/specific
Ivan Maidanski [Wed, 7 Jun 2017 22:05:52 +0000 (01:05 +0300)]
windows-untested: Do not build gc_dlopen/pcr_interface/real_malloc/specific

These .c files do not define anything for Windows platform.

7 years agoTravis CI: Test also configure --disable-thread-local-alloc
Ivan Maidanski [Wed, 7 Jun 2017 21:46:11 +0000 (00:46 +0300)]
Travis CI: Test also configure --disable-thread-local-alloc

7 years agoSupport configure --disable-thread-local-alloc option (similar for CMake)
Ivan Maidanski [Wed, 7 Jun 2017 21:42:30 +0000 (00:42 +0300)]
Support configure --disable-thread-local-alloc option (similar for CMake)

* CMakeLists.txt (enable_thread_local_alloc): New option (on by
default).
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT
|| CMAKE_USE_WIN32_THREADS_INIT] (SRC): Add thread_local_alloc.c only
if enable_thread_local_alloc.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT
|| CMAKE_USE_WIN32_THREADS_INIT]: Define THREAD_LOCAL_ALLOC macro only
if enable_thread_local_alloc.

* Makefile.am (libgc_la_SOURCES): Add thread_local_alloc.c only if
THREAD_LOCAL_ALLOC.
* configure.ac (thread-local-alloc): New option.
* configure.ac: AC_DEFINE(THREAD_LOCAL_ALLOC) only if
enable_thread_local_alloc is yes or unset.
* configure.ac (THREAD_LOCAL_ALLOC): New AM_CONDITIONAL.

7 years agoGroup common defines for POSIX platforms in configure and CMake scripts
Ivan Maidanski [Wed, 7 Jun 2017 08:53:14 +0000 (11:53 +0300)]
Group common defines for POSIX platforms in configure and CMake scripts
(code refactoring)

* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT]: Eliminate duplication of
ADD_DEFINITIONS of GC_THREADS, _REENTRANT, PARALLEL_MARK,
THREAD_LOCAL_ALLOC (and AC_MSG_WARN) for aix, cygwin, darwin, freebsd,
gnu (including kfreebsd), hpux11, irix, linux, nacl, netbsd, openbsd,
osf, solaris platforms; add comment.
* configure.ac [THREADS=posix]: Likewise.
* configure.ac [THREADS=posix]: Remove explicit hpux10 case handling.

7 years agoEliminate 'unused variable' compiler warning in remove_all_threads_but_me
Ivan Maidanski [Wed, 7 Jun 2017 07:18:28 +0000 (10:18 +0300)]
Eliminate 'unused variable' compiler warning in remove_all_threads_but_me
(fix commit 0fc61f2)

* pthread_support.c [CAN_HANDLE_FORK] (GC_remove_all_threads_but_me):
Declare "res" local variable only if THREAD_LOCAL_ALLOC and
not USE_CUSTOM_SPECIFIC.

7 years agoRemove extraneous semicolons after AC_MSG_WARN (configure)
Ivan Maidanski [Tue, 6 Jun 2017 22:14:16 +0000 (01:14 +0300)]
Remove extraneous semicolons after AC_MSG_WARN (configure)

* configure.ac (AC_MSG_WARN): Remove trailing ';' symbol.

7 years agoFix broken external links in documentation
Ivan Maidanski [Tue, 6 Jun 2017 22:00:26 +0000 (01:00 +0300)]
Fix broken external links in documentation

* doc/gcdescr.html: Replace broken URLs to external document with
working ones.
* doc/overview.html: Likewise.

7 years agoFix URL to GitHub bdwgc master in overview.html
Ivan Maidanski [Tue, 6 Jun 2017 21:40:21 +0000 (00:40 +0300)]
Fix URL to GitHub bdwgc master in overview.html
(fix commit e3456e4)

* doc/overview.html (Contacts and new release announcements): Correct
link to GitHub bdwgc master.

7 years agoUpdate documentation about bugs reporting and new releases notification
Ivan Maidanski [Tue, 6 Jun 2017 07:30:50 +0000 (10:30 +0300)]
Update documentation about bugs reporting and new releases notification

* README.md (Download): Add link to BDWGC Download page on GitHub.
* README.md (Overview): Change link (for the further information) from
hboehm.info/gc to doc/overview.html.
* README.md (Bugs): Remove information about bugs reporting from this
section.
* README.md (Feedback, Contribution, Questions and Notifications): New
section.
* configure.ac (AC_INIT): Change URI for reporting bugs.
* doc/gc.man (SEE ALSO): Add link to the BDWGC main page on GitHub.
* doc/gcdescr.html: Remove information how to provide feedback.
* doc/overview.html (Contacts and Mailing List): Update information
(recommend use of GitHub and Stack Overflow, provide links to the
archives of the former mailing lists).

7 years agoUpdate several email addresses in AUTHORS file
Ivan Maidanski [Thu, 1 Jun 2017 19:14:09 +0000 (22:14 +0300)]
Update several email addresses in AUTHORS file

7 years agoUpdate ChangeLog file
Ivan Maidanski [Wed, 31 May 2017 20:15:01 +0000 (23:15 +0300)]
Update ChangeLog file

7 years agoUpdate ChangeLog file (v7.6 changes only)
Ivan Maidanski [Wed, 31 May 2017 18:10:07 +0000 (21:10 +0300)]
Update ChangeLog file (v7.6 changes only)

7 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Wed, 31 May 2017 17:27:58 +0000 (20:27 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

7 years agoTravis CI: Test --with-libatomic-ops=none instead of -D GC_BUILTIN_ATOMIC
Ivan Maidanski [Tue, 30 May 2017 08:10:15 +0000 (11:10 +0300)]
Travis CI: Test --with-libatomic-ops=none instead of -D GC_BUILTIN_ATOMIC

7 years agoAllow configure --with-libatomic-ops=none to use GCC atomic intrinsics
Ivan Maidanski [Tue, 30 May 2017 08:08:14 +0000 (11:08 +0300)]
Allow configure --with-libatomic-ops=none to use GCC atomic intrinsics

* configure.ac (libatomic-ops): Allow "none" value for
--with-libatomic-ops option; update help message; use "none" as the
default value if THREADS=none.
* configure.ac [with_libatomic_ops!=no]: Refine comment; call
PKG_CHECK_MODULES(ATOMIC_OPS) only if with_libatomic_ops!=none.
* configure.ac [with_libatomic_ops!=no] (which libatomic_ops to use):
If with_libatomic_ops = none and THREADS != none then
AC_MSG_RESULT(none) and AC_DEFINE(GC_BUILTIN_ATOMIC).

7 years agoTravis CI: Test without clone libatomic_ops
Ivan Maidanski [Tue, 30 May 2017 07:34:49 +0000 (10:34 +0300)]
Travis CI: Test without clone libatomic_ops

7 years agoTravis CI: Fix 'make distcheck' failure caused by missing libatomic_ops
Ivan Maidanski [Mon, 29 May 2017 08:12:14 +0000 (11:12 +0300)]
Travis CI: Fix 'make distcheck' failure caused by missing libatomic_ops
(fix commit e2f72bd)

7 years agoFix external libatomic_ops pkg-config-based detection
Ivan Maidanski [Mon, 29 May 2017 07:51:44 +0000 (10:51 +0300)]
Fix external libatomic_ops pkg-config-based detection

Fall back to AC_CHECK_HEADER-based detection of libatomic_ops library
if PKG_CHECK_MODULES failed to find the library.

* configure.ac [missing_libatomic_ops=true]: Call
AC_CHECK_HEADER(atomic_ops.h) and set missing_libatomic_ops=false if
atomic_ops.h is found; add comment.

7 years agoDo not require libatomic_ops for single-threaded builds (configure)
Ivan Maidanski [Mon, 29 May 2017 07:37:12 +0000 (10:37 +0300)]
Do not require libatomic_ops for single-threaded builds (configure)

* configure.ac [with_libatomic_ops!=no]: Do not call
PKG_CHECK_MODULES(ATOMIC_OPS) if THREADS = none
* configure.ac [with_libatomic_ops!=no] (which libatomic_ops to use):
Report "none" if if THREADS = none.

7 years agoImprove detection of internal libatomic_ops (configure)
Ivan Maidanski [Mon, 29 May 2017 07:22:39 +0000 (10:22 +0300)]
Improve detection of internal libatomic_ops (configure)

* configure.ac [with_libatomic_ops=no]: Check presence of
libatomic_ops/src/atomic_ops.h file instead of libatomic_ops/src
folder.

7 years agoUpdate AUTHORS file (add Bernd Kuhls)
Ivan Maidanski [Mon, 29 May 2017 06:39:10 +0000 (09:39 +0300)]
Update AUTHORS file (add Bernd Kuhls)

7 years agoFix 'missing libc-version.h' build error (uClibc/x86[_64])
Bernd Kuhls [Sun, 28 May 2017 18:21:09 +0000 (20:21 +0200)]
Fix 'missing libc-version.h' build error (uClibc/x86[_64])
(fix commit 3d34255)

uClibc defines __GLIBC__ but does not contain libc-version.h file.

* include/private/gcconfig.h [(I386 || X86_64) && LINUX && __GLIBC__]
(GLIBC_2_19_TSX_BUG): Do not define (and do not include
gnu/libc-version.h) if __UCLIBC__.

7 years agoFix typo in configure help message
Ivan Maidanski [Wed, 24 May 2017 21:37:01 +0000 (00:37 +0300)]
Fix typo in configure help message

* ChangeLog: Fix a typo ("an").
* configure.ac (libatomic-ops): Fix a typo ("an") in help message.

7 years agoWorkaround 'int shift by negative amount' false defect in GC_finalize
Ivan Maidanski [Wed, 24 May 2017 08:30:42 +0000 (11:30 +0300)]
Workaround 'int shift by negative amount' false defect in GC_finalize
(fix commits eeb118d, d46fbe0)

* finalize.c [GC_ASSERTIONS || LINT2] (GC_finalize): Replace GC_ASSERT
(for curr_fo and log_fo_table_size) with a conditional ABORT.

7 years agoEliminate 'conditional expression is always true' code defect in GC_init
Ivan Maidanski [Tue, 23 May 2017 07:17:12 +0000 (10:17 +0300)]
Eliminate 'conditional expression is always true' code defect in GC_init

* misc.c (GC_init): Move ALIGNMENT>GC_DS_TAGS expression from
"if" statement to #if.

7 years agoWorkaround 'comparison of identical expressions' false code defects
Ivan Maidanski [Tue, 23 May 2017 06:23:54 +0000 (09:23 +0300)]
Workaround 'comparison of identical expressions' false code defects

* thread_local_alloc.c [THREAD_LOCAL_ALLOC] (GC_init_thread_local):
New local variable (res); save result of GC_setspecific and
GC_key_create to res; replace res!=0 with COVERT_DATAFLOW(res)!=0.
* pthread_support.c [CAN_HANDLE_FORK] (GC_remove_all_threads_but_me):
Likewise.

7 years agoWorkaround 'array compared to 0', 'untrusted loop bound' false defects
Ivan Maidanski [Mon, 22 May 2017 22:01:08 +0000 (01:01 +0300)]
Workaround 'array compared to 0', 'untrusted loop bound' false defects

* dyn_load.c [SOLARISDL && !USE_PROC_FOR_LIBRARIES]
(GC_FirstDLOpenedLinkMap): Wrap access to dynStructureAddr (which value
obtained from a weak symbol) into COVERT_DATAFLOW() in comparison to 0.
* dyn_load.c [HAVE_DL_ITERATE_PHDR && !DL_ITERATE_PHDR_STRONG]
(GC_register_main_static_data): Wrap access to dl_iterate_phdr weak
symbol into COVERT_DATAFLOW() in comparison to 0.
* dyn_load.c [HAVE_DL_ITERATE_PHDR] (GC_FirstDLOpenedLinkMap): Wrap
access to _DYNAMIC weak symbol into COVERT_DATAFLOW() in comparison to 0.
* include/private/gc_priv.h (TRUSTED_STRING): Pass the argument through
COVERT_DATAFLOW.
* include/private/gcconfig.h (COVERT_DATAFLOW): New macro.
* os_dep.c [SEARCH_FOR_DATA_START] (GC_init_linux_data_start): Wrap
access to __data_start and GC_data_start into COVERT_DATAFLOW() in
comparison to 0.
* tests/disclaim_bench.c: Update comment for include gc_priv.h.
* tests/disclaim_bench.c (main): Pass the integer value obtained from
command-line argument (and which is used as a loop boundary) through
COVERT_DATAFLOW().
* tests/test_cpp.cc (main): Likewise.

7 years agoTravis CI: Test also 'make distcheck'
Ivan Maidanski [Mon, 22 May 2017 19:51:20 +0000 (22:51 +0300)]
Travis CI: Test also 'make distcheck'

Dependencies used to generate configure:
* autoconf 2.69
* automake 1.15
* m4 1.4.18
* libtool 2.4.6
* pkg-config 0.29.2

7 years agoTravis CI: Setup dist tarball uploading to GitHub on tag creation
Ivan Maidanski [Mon, 22 May 2017 07:50:07 +0000 (10:50 +0300)]
Travis CI: Setup dist tarball uploading to GitHub on tag creation

7 years agoTravis CI: Reformat .yml file by travis tool
Ivan Maidanski [Mon, 22 May 2017 07:33:32 +0000 (10:33 +0300)]
Travis CI: Reformat .yml file by travis tool

7 years agoRemove duplicated sample code in leak.md
Ivan Maidanski [Mon, 22 May 2017 06:06:24 +0000 (09:06 +0300)]
Remove duplicated sample code in leak.md

* doc/leak.md (Example): Remove code snippets which are similar to
that of include/leak_detector.h and leak_test.c; replace
GC_find_leak=1 with GC_set_find_leak(1).

7 years agoConvert some (small) .html files to Markdown format
Ivan Maidanski [Fri, 19 May 2017 15:55:29 +0000 (18:55 +0300)]
Convert some (small) .html files to Markdown format

The "doc" files converted: debugging.html, finalization.html,
leak.html, porting.html, scale.html, simple_example.html.

* README.md: Replace leak.html with leak.md; replace debugging.html with
debugging.md.
* doc/debugging.html: Change file suffix to .md; convert text format
from HTML to Markdown.
* doc/finalization.html: Likewise.
* doc/leak.html: Likewise.
* doc/porting.html: Likewise.
* doc/scale.html: Likewise.
* doc/simple_example.html: Likewise.
* doc/gcdescr.html: Replace scale.html with scale.md; replace
finalization.html with finalization.md.
* doc/gcinterface.html: Likewise.
* doc/doc.am (dist_doc_DATA): Rename doc/debugging.html to
doc/debugging.md, finalization.html to finalization.md, leak.html to
leak.md, porting.html to porting.md, scale.html to scale.md,
simple_example.html to simple_example.md.
* doc/overview.html: Replace simple_example.html with
simple_example.md; replace leak.html with leak.md; replace scale.html
with scale.md; replace finalization.html with finalization.md; replace
debugging.html with debugging.md.

7 years agoFix various typos in doc/README and .html files
Ivan Maidanski [Thu, 18 May 2017 22:52:59 +0000 (01:52 +0300)]
Fix various typos in doc/README and .html files

* doc/README.Mac: Fix a typo ("command-line").
* doc/README.amiga: Fix typos ("recommendation", "compiling",
"favorably").
* doc/README.cords: Fix a typo ("and").
* doc/README.macros: Fix a typo ("canceled").
* doc/README.sgi: Fix a typo ("related").
* doc/README.solaris2: Fix a typo ("offset").
* doc/leak.html: Fix a typo ("e.g.").
* doc/overview.html: Fix a typo ("December").
* doc/porting.html: Fix typos ("not supported yet", "signaled",
"not defined yet").
* doc/scale.html: Fix typos ("free", "busy-waiting").
* doc/simple_example.html: Fix a typo ("have not yet").
* tests/test_cpp.cc (main): Fix a typo ("command line") in comment.

7 years agoRemove unused ALIGN_DOUBLE macro (TILE-Gx/Pro)
Ivan Maidanski [Thu, 18 May 2017 21:44:29 +0000 (00:44 +0300)]
Remove unused ALIGN_DOUBLE macro (TILE-Gx/Pro)
(fix commits e35a417, 1240658)

* doc/porting.html (ALIGN_DOUBLE): Remove documentation for the macro.
* include/private/gcconfig.h [TILEPRO, TILEGX] (ALIGN_DOUBLE): Remove
macro (no longer needed).

7 years agoReplace XXX_THREADS with GC_THREADS macro in scale.html
Ivan Maidanski [Thu, 18 May 2017 21:30:11 +0000 (00:30 +0300)]
Replace XXX_THREADS with GC_THREADS macro in scale.html
(fix commit e559309)

* doc/scale.html: Replace -DXXX_THREADS with -DGC_THREADS.

7 years agoWorkaround 'waiting while holding lock' code defect in stop_world (Unix)
Ivan Maidanski [Thu, 18 May 2017 09:00:45 +0000 (12:00 +0300)]
Workaround 'waiting while holding lock' code defect in stop_world (Unix)

* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL && LINT2]
(GC_stop_world): Redefine WAIT_UNIT to 1; call sched_yield() instead
of usleep(); add comment.

7 years agoWorkaround 'int shift by negative amount' false code defect in finalize
Ivan Maidanski [Tue, 16 May 2017 21:40:33 +0000 (00:40 +0300)]
Workaround 'int shift by negative amount' false code defect in finalize
(fix commit eeb118d)

* finalize.c (GC_register_disappearing_link_inner,
GC_register_finalizer_inner): Replace GC_ASSERT (for log_size) with
a conditional ABORT if LINT2.

7 years agoDefine GC_THREADS instead of GC_x_THREADS in Makefiles
Ivan Maidanski [Fri, 12 May 2017 20:32:23 +0000 (23:32 +0300)]
Define GC_THREADS instead of GC_x_THREADS in Makefiles
(code refactoring)

* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT] (SRC): Add
thread_local_alloc.c in a single place.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT]: Define GC_THREADS macro
instead of GC_LINUX_THREADS, GC_AIX_THREADS, GC_HPUX_THREADS,
GC_OPENBSD_THREADS, GC_FREEBSD_THREADS, GC_NETBSD_THREADS,
GC_SOLARIS_THREADS, GC_IRIX_THREADS, GC_DARWIN_THREADS, GC_OSF1_THREADS.
* configure.ac [THREADS=posix]: Likewise.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT]: Handle
*-*-aix*, *-*-*freebsd* (including kfreebsd), *-*-gnu*, *-*-irix*,
*-*-openbsd*, *-*-osf*, *-*-solaris* targets in the same ways as
*-*-*linux*.
* Makefile.direct (CFLAGS): Do not mention GC_HPUX_THREADS in comment.
* README.QUICK: Refine documentation about macro and configure option
for builds with (and without) threads support.
* configure.ac (GC_AIX_THREADS, GC_DARWIN_THREADS, GC_FREEBSD_THREADS,
GC_HPUX_THREADS, GC_IRIX_THREADS, GC_LINUX_THREADS, GC_NETBSD_THREADS,
GC_OPENBSD_THREADS, GC_OSF1_THREADS, GC_SOLARIS_THREADS,
GC_WIN32_THREADS, GC_RTEMS_PTHREADS): Remove AH_TEMPLATE.
* configure.ac [THREADS=posix]: Handle *-*-aix*, *-*-irix* targets in
the same ways as *-*-*linux*.
* configure.ac [THREADS=win32 || THREADS=dgux386 || THREADS=aix
|| THREADS=rtems]: Define GC_THREADS macro instead of GC_WIN32_THREADS,
GC_DGUX386_THREADS, GC_AIX_THREADS, GC_RTEMS_PTHREADS.
* doc/README.darwin: Replace GC_MACOSX_THREADS with GC_THREADS.
* doc/README.environment (doc/README.environment): Replace
GC_OSF1_THREADS with OSF1.
* doc/README.hp: Replace GC_HPUX_THREADS with GC_THREADS.
* doc/README.linux: Replace GC_LINUX_THREADS with GC_THREADS.
* doc/scale.html: Likewise.
* doc/README.macros (GC_SOLARIS_THREADS, GC_IRIX_THREADS,
GC_HPUX_THREADS, GC_LINUX_THREADS, GC_OSF1_THREADS, GC_FREEBSD_THREADS,
GC_NETBSD_THREADS, GC_OPENBSD_THREADS, GC_DARWIN_THREADS,
GC_AIX_THREADS, GC_DGUX386_THREADS, GC_WIN32_THREADS): Add note that
the macro is deprecated (GC_THREADS one should be used instead).
* doc/README.sgi: Replace GC_IRIX_THREADS with GC_THREADS.
* doc/README.solaris2: Do not mention GC_SOLARIS_THREADS.
* doc/gcinterface.html: Do not mention GC_XXXX_THREADS.