]> granicus.if.org Git - gc/log
gc
7 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Tue, 19 Dec 2017 08:10:23 +0000 (11:10 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

7 years agoPrevent 'Unexpected heap growth' in single-threaded gctest (Linux/x64)
Ivan Maidanski [Tue, 19 Dec 2017 07:22:15 +0000 (10:22 +0300)]
Prevent 'Unexpected heap growth' in single-threaded gctest (Linux/x64)

Empirically, with incremental GC, the heap tends to grow largely as
a result of the GC not getting enough cycles.

* tests/test.c [!VERY_SMALL_CONFIG && CPP_WORDSZ==64]
(check_heap_stats): Increase max_heap_sz by ~5% (to 24M).

7 years agoEliminate 'value exceeds maximum object size' GCC warning in huge_test
Ivan Maidanski [Wed, 29 Nov 2017 08:44:17 +0000 (11:44 +0300)]
Eliminate 'value exceeds maximum object size' GCC warning in huge_test
(Cherry-pick commit 012fc6c8 from 'release-7_6' branch.)

* tests/huge_test.c [!GC_ATTR_ALLOC_SIZE] (GC_ATTR_ALLOC_SIZE): Define
to empty (before include gc.h).

7 years agoEliminate 'this statement may fall through' GCC warnings
Ivan Maidanski [Wed, 29 Nov 2017 08:42:47 +0000 (11:42 +0300)]
Eliminate 'this statement may fall through' GCC warnings

* cord/cordprnt.c (extract_conv_spec): Eliminate fall through in
a switch statement.
* cord/tests/de.c (do_command): Replace "fall through:" comment with
"FALLTHRU" formal comment (on a new line).
* win32_threads.c [!GC_PTHREADS && !GC_NO_THREADS_DISCOVERY]
(GC_DllMain): Likewise.

7 years agoFix marking of disclaim-reachable objects in the incremental mode
Petter A. Urkedal [Sun, 3 Dec 2017 11:42:59 +0000 (12:42 +0100)]
Fix marking of disclaim-reachable objects in the incremental mode

Issue #192 (bdwgc).

Unconditional marking is done analogously to marking from uncollectible
blocks, since they are meant to secure access to data for disclaim
notifiers after the data is no longer marked.

* mark.c [ENABLE_DISCLAIM] (GC_push_next_marked_dirty): Honor
MARK_UNCONDITIONALLY when rescanning dirty blocks during incremental
marking.

7 years agoFix data race in do_local_mark when comparing active_count to helper_count
Ivan Maidanski [Fri, 1 Dec 2017 16:38:02 +0000 (19:38 +0300)]
Fix data race in do_local_mark when comparing active_count to helper_count
(Cherry-pick commit 66ae55e3 from 'master' branch.)

* mark.c [PARALLEL_MARK] (has_inactive_helpers): New static function
(which compares GC_active_count to GC_helper_count with the mark lock
held).
* mark.c [PARALLEL_MARK && GC_ASSERTIONS] (GC_do_local_mark): Remove
GC_acquire_mark_lock() with immediate GC_acquire_mark_unlock(); add
the appropriate comment to the function description instead.
* mark.c [PARALLEL_MARK] (GC_do_local_mark): Call has_inactive_helpers()
instead of GC_active_count<GC_helper_count; do not call
has_inactive_helpers() unless local_top>local_mark_stack+1.

7 years agoFix data race in mark_thread when updating mark_no
Ivan Maidanski [Fri, 1 Dec 2017 16:23:13 +0000 (19:23 +0300)]
Fix data race in mark_thread when updating mark_no
(Cherry-pick commit 266c2891 from 'release-7_6' branch.)

* mark.c [PARALLEL_MARK] (GC_mark_local, GC_help_marker): Update
description comment; remove GC_acquire_mark_lock() call at the function
beginning; remove GC_release_mark_lock() call on return.
* mark.c [PARALLEL_MARK] (GC_do_parallel_mark): Remove
GC_acquire/release_mark_lock() calls around GC_mark_local() call.
* pthread_support.c [PARALLEL_MARK] (GC_mark_thread): Remove
GC_release_mark_lock() call.
* win32_threads.c [PARALLEL_MARK] (GC_mark_thread): Likewise.

7 years agoFix lack of barriers to synchronize memory for suspend_handler
Ivan Maidanski [Thu, 23 Nov 2017 23:21:46 +0000 (02:21 +0300)]
Fix lack of barriers to synchronize memory for suspend_handler

pthread_kill is not on the list of functions which synchronize memory.

* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL]
(GC_world_is_stopped): Reformat comment.
* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL]
(GC_suspend_handler_inner): Use AO_load_acquire instead of AO_load
to fetch the value of GC_stop_count; add comment.
* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL]
(GC_start_world): Use AO_store_release instead of AO_store to reset
GC_world_is_stopped; add comment.

7 years agoFix data race in last_stop_count access (suspend_handler_inner)
Ivan Maidanski [Thu, 23 Nov 2017 17:15:54 +0000 (20:15 +0300)]
Fix data race in last_stop_count access (suspend_handler_inner)
(Cherry-pick commit 3961ab98 from 'release-7_6' branch.)

* include/private/pthread_stop_world.h [!GC_OPENBSD_UTHREADS]
(thread_stop_info.last_stop_count): Do not define if NACL; change the
type from word to AO_t; add volatile qualifier; fix a typo in comment
("GC_stop_count").
* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL]
(GC_suspend_handler_inner): Replace
me->stop_info.last_stop_count=my_stop_count with
AO_store_release(&me->stop_info.last_stop_count,my_stop_count).
* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL]
(GC_suspend_all): Replace p->stop_info.last_stop_count with
AO_load(&p->stop_info.last_stop_count).

7 years agoFix data race when getting object size in explicitly-typed allocators
Ivan Maidanski [Fri, 10 Nov 2017 17:07:16 +0000 (20:07 +0300)]
Fix data race when getting object size in explicitly-typed allocators
(Cherry-pick commit eb33bda5 from 'release-7_6' branch.)

* typd_mlc.c (COMPLEX): Reformat comment.
* typd_mlc.c (GC_malloc_explicitly_typed,
GC_malloc_explicitly_typed_ignore_off_page, GC_calloc_explicitly_typed):
Always use BYTES_TO_GRANULES(GC_size(op)) instead of GC_size_map[lb] to
determine size of the allocated object in granules (because the value
of GC_size_map[lb] might be updated by another thread since the value
use in GC_malloc_kind); add comment.

7 years agoFix data race in a list referenced by A.aa (gctest)
Ivan Maidanski [Fri, 3 Nov 2017 17:08:09 +0000 (20:08 +0300)]
Fix data race in a list referenced by A.aa (gctest)
(Cherry-pick commit 2f1b8e8 from 'release-7_6' branch.)

* tests/test.c [!AO_CLEAR] (AO_t): Define.
* tests/test.c [!AO_HAVE_load_acquire] (AO_load_acquire): New static
function (which uses FINALIZER_LOCK/FINALIZER_UNLOCK).
* tests/test.c [!AO_HAVE_store_release] (AO_store_release): Likewise.
* tests/test.c (A): Add volatile qualifier; change the type of aa
field from sexpr to AO_t.
* tests/test.c (a): Do not define (and undefine).
* tests/test.c (a_set, a_get): New macro (based on AO_store_release
and AO_load_acquire, respectively).
* tests/test.c (reverse_test_inner): Use a_set() and a_get() to store
and fetch the value of a, respectively.

7 years agoFix assertion violation about disabled cancel in try_to_collect_inner
Ivan Maidanski [Wed, 29 Nov 2017 22:10:20 +0000 (01:10 +0300)]
Fix assertion violation about disabled cancel in try_to_collect_inner
(Cherry-pick commit 218bfbfa from 'master' branch.)

* misc.c [!GC_DISABLE_INCREMENTAL && !KEEP_BACK_PTRS]
(GC_enable_incremental): Wrap GC_gcollect_inner and GC_read_dirty calls
into DISABLE/RESTORE_CANCEL.

7 years agoFix data race in make_descriptor when setting explicit_typing_initialized
Ivan Maidanski [Wed, 29 Nov 2017 17:15:49 +0000 (20:15 +0300)]
Fix data race in make_descriptor when setting explicit_typing_initialized
(fix commit 5f350a0)

* typd_mlc.c [AO_HAVE_load_acquire] (GC_explicit_typing_initialized):
Add volatile qualifier.
* typd_mlc.c [AO_HAVE_load_acquire] (GC_make_descriptor): Remove
cast of &GC_explicit_typing_initialized; do not check THREADS macro;
fallback to locked checking of GC_explicit_typing_initialized if
AO_HAVE_store_release is not defined; use AO_store_release to set
GC_explicit_typing_initialized (to true).
* typd_mlc.c (GC_make_descriptor): Reformat code dealing with
GC_explicit_typing_initialized (check whether AO_HAVE_load_acquire is
defined only once).

7 years agoAvoid data race in finalized_count (gctest)
Ivan Maidanski [Fri, 3 Nov 2017 08:03:04 +0000 (11:03 +0300)]
Avoid data race in finalized_count (gctest)
(Cherry-pick commit ffc89ea1 from 'release-7_6' branch.)

* tests/test.c (FINALIZER_LOCK, FINALIZER_UNLOCK): New macro.
* tests/test.c [GC_PTHREADS] (incr_lock): Move static variable out
of finalizer() and mktree() (use a single lock variable to access
finalized_count in finalizer, mktree and tree_test).
* tests/test.c (dropped_something): Change type back to int; remove
volatile.
* tests/test.c (finalizer, mktree): Use FINALIZER_[UN]LOCK() instead
of PCR_ThCrSec_Enter/ExitSys(), pthread_mutex_[un]lock(),
Enter/LeaveCriticalSection().
* tests/test.c (tree_test): Use FINALIZER_[UN]LOCK() to avoid data
race when accessing finalized_count and dropped_something; do not use
AO_load() and AO_store() to access dropped_something.

7 years agoUpdate comment in finalized_disclaim to match FINALIZER_CLOSURE_FLAG
Ivan Maidanski [Wed, 29 Nov 2017 22:24:33 +0000 (01:24 +0300)]
Update comment in finalized_disclaim to match FINALIZER_CLOSURE_FLAG
(fix commit 012da3f)

* fnlz_mlc.c [ENABLE_DISCLAIM] (GC_finalized_disclaim): Update/refine
comment (about the lowest 2 bits of the first word).

7 years agoFix typo in a function name in README.sgi
Ivan Maidanski [Thu, 16 Nov 2017 08:20:32 +0000 (11:20 +0300)]
Fix typo in a function name in README.sgi

* doc/README.sgi (4): Fix a typo ("pthread_cond_timedwait").

7 years agoFix typo in 'gcdescr' documentation file
Ivan Maidanski [Fri, 10 Nov 2017 07:33:32 +0000 (10:33 +0300)]
Fix typo in 'gcdescr' documentation file
(Cherry-pick commit 419f4de9 from 'master' branch.)

* doc/gcdescr.html (Allocation): Fix a typo ("the request is rounded").

7 years ago[7.4.6] v7.4.6
Ivan Maidanski [Thu, 26 Oct 2017 05:22:43 +0000 (08:22 +0300)]
[7.4.6]

Bump gc version to 7.4.6

* ChangeLog (7.4.6): Set release date.
* Makefile.am (LIBGC_VER_INFO): Increment revision (change info to
3:1:1).
* README.md: Bump micro version.
* configure.ac (AC_INIT): Likewise.
* include/gc_version.h (GC_TMP_VERSION_MICRO): Likewise.

7 years agoUpdate ChangeLog file (v7.4 changes only)
Ivan Maidanski [Wed, 25 Oct 2017 15:32:35 +0000 (18:32 +0300)]
Update ChangeLog file (v7.4 changes only)

7 years agoTravis CI: Test NO_CLOCK
Ivan Maidanski [Wed, 25 Oct 2017 08:12:34 +0000 (11:12 +0300)]
Travis CI: Test NO_CLOCK

7 years agoRefine should_invoke_finalizers documentation
Ivan Maidanski [Wed, 18 Oct 2017 19:37:30 +0000 (22:37 +0300)]
Refine should_invoke_finalizers documentation

* include/gc.h (GC_should_invoke_finalizers): Add comment that it is
not synchronized.

7 years agoAllow PKG_CHECK_MODULES in configure.ac to be commented out easily
Ivan Maidanski [Mon, 16 Oct 2017 08:00:53 +0000 (11:00 +0300)]
Allow PKG_CHECK_MODULES in configure.ac to be commented out easily
(Cherry-pick commits 3d34335fbb22e9 from 'master' branch.)

* configure.ac [$with_libatomic_ops!=no && $THREADS!=none]
(missing_libatomic_ops): Set to true (before PKG_CHECK_MODULES).
* configure.ac [$missing_libatomic_ops] (PKG_CHECK_MODULES): Set
missing_libatomic_ops back to false if atomic_ops module is not found;
add comment (about pkg-config and the possibility to comment out
PKG_CHECK_MODULES).

7 years agoFix typos in documentation (for extend_size_map and ews4800)
Ivan Maidanski [Mon, 23 Oct 2017 21:10:12 +0000 (00:10 +0300)]
Fix typos in documentation (for extend_size_map and ews4800)

* doc/README.ews4800: Fix typos ("32-bit", "64-bit").
* misc.c (GC_extend_size_map): Fix typo ("16-byte") in a comment.

7 years ago.gitignore: Do not ignore include/private/config.h
Ivan Maidanski [Tue, 17 Oct 2017 21:20:47 +0000 (00:20 +0300)]
.gitignore: Do not ignore include/private/config.h

config.h was moved to "include" folder in gc-7.4.0.

7 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Tue, 10 Oct 2017 22:06:54 +0000 (01:06 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

7 years agoFix missing atomic_count and realloc_count incrementation in gctest
Ivan Maidanski [Sun, 8 Oct 2017 10:09:46 +0000 (13:09 +0300)]
Fix missing atomic_count and realloc_count incrementation in gctest
(Cherry-pick commit e60b3b8 from 'release-7_6' branch.)

* tests/test.c [!AT_END && !THREADS] (reverse_test_inner): Increment
realloc_count after GC_REALLOC() call.
* tests/test.c (run_one_test): Increment atomic_count after
(void)GC_MALLOC_ATOMIC(0) call.

7 years agoTravis CI: Test USE_CUSTOM_SPECIFIC
Ivan Maidanski [Mon, 28 Aug 2017 07:38:18 +0000 (10:38 +0300)]
Travis CI: Test USE_CUSTOM_SPECIFIC
(Cherry-pick commit 32a54f3 from 'release-7_6' branch.)

7 years agoTravis CI: Test some --enable-munmap configurations with non-incremental GC
Ivan Maidanski [Tue, 22 Aug 2017 06:09:04 +0000 (09:09 +0300)]
Travis CI: Test some --enable-munmap configurations with non-incremental GC
(Cherry-pick commit 12711e1 from 'release-7_6' branch.)

7 years agoEliminate most of collisions in GC_threads on Linux/x64
Ivan Maidanski [Thu, 24 Aug 2017 08:34:05 +0000 (11:34 +0300)]
Eliminate most of collisions in GC_threads on Linux/x64
(Cherry-pick commits 85fce54e897b41 from 'master' branch.)

On some targets (e.g., Linux/x64) pthread_t values always have zero
in the lowest byte (e.g. if pthread_t is actually a page-aligned
pointer) thus causing all the created thread descriptors to have
a collision at GC_threads[0].  This commit mixes 3 lowest bytes
of thread id with a XOR operation (thus greatly reduces the
probability of collisions in GC_threads).
Windows thread Id rarely has non-zero highest half of DWORD, so
it is OK to use only the lowest one for hash value computation.

* include/private/pthread_support.h (THREAD_TABLE_SZ): Do not
define if already defined; refine comment.
* pthread_support.c (THREAD_TABLE_INDEX): New macro (similar to that
in win32_threads.c).
* pthread_support.c (GC_new_thread, GC_delete_thread,
GC_delete_gc_thread, GC_lookup_thread): Replace
NUMERIC_THREAD_ID(id)%THREAD_TABLE_SZ to THREAD_TABLE_INDEX(id).
* pthread_support.c (GC_lookup_thread): Remove hv local variable.
* win32_threads.c (THREAD_TABLE_INDEX): Replace (id>>2) to
((id>>8)^id).
* win32_threads.c [GC_PTHREADS] (GC_lookup_pthread): Define win32_id
local variable to pass it to THREAD_TABLE_INDEX() instead of passing
GET_PTHREAD_MAP_CACHE(id) directly.

7 years agoChange type of THREAD_TABLE_INDEX result to int in win32_threads.c
Ivan Maidanski [Wed, 23 Aug 2017 08:46:41 +0000 (11:46 +0300)]
Change type of THREAD_TABLE_INDEX result to int in win32_threads.c
(code refactoring)

* win32_threads.c (THREAD_TABLE_INDEX): Cast result to int; remove cast
of argument to word type; add comment.
* win32_threads.c (GC_new_thread, GC_delete_gc_thread_no_free,
GC_delete_thread): Change type of hv local variable from word to int.
* win32_threads.c (GC_lookup_thread_inner): Remove hv local variable;
remove "register" keyword for p local variable.
* win32_threads.c (GC_lookup_pthread): Change type of hv_guess local
variable from word to int.

7 years agoFix missing [un]collectable_count increments in gctest
Ivan Maidanski [Wed, 27 Sep 2017 21:52:40 +0000 (00:52 +0300)]
Fix missing [un]collectable_count increments in gctest

* tests/test.c [!DBG_HDRS_ALL] (run_one_test): Increment
uncollectable_count instead of collectable_count (for
GC_malloc_uncollectable(0)).
* tests/test.c [!DBG_HDRS_ALL] (run_one_test): Add missing increments
of collectable_count for GC_malloc(8) and GC_malloc(17).
* tests/test.c (run_one_test): Add missing increment of
collectable_count for (void)GC_MALLOC(0).

7 years agoFix get_maps on proc maps file asynchronous growth
Ivan Maidanski [Tue, 26 Sep 2017 21:56:14 +0000 (00:56 +0300)]
Fix get_maps on proc maps file asynchronous growth

Issue #179 (bdwgc).

Asynchronous growth of /proc/self/maps could be caused by some thread
which is not currently registered (e.g. stack allocation on thread
creation or a non-GC heap allocation from an unregistered thread).

* os_dep.c [NEED_PROC_MAPS] (GC_get_maps): Refine comment.
* os_dep.c [NEED_PROC_MAPS && THREADS] (GC_get_maps): Replace ABORT
with WARN call; refine printed message; add comment.

7 years agoFix infinite mark_some calls after memory mapping disappeared (Glibc)
Ivan Maidanski [Tue, 19 Sep 2017 07:51:24 +0000 (10:51 +0300)]
Fix infinite mark_some calls after memory mapping disappeared (Glibc)

Issue #179 (bdwgc).

* mark.c [WRAP_MARK_SOME && REGISTER_LIBRARIES_EARLY] (GC_mark_some):
Call GC_cond_register_dynamic_libraries (with the world running)
before GC_invalidate_mark_state().

7 years agoFix SIGSEGV in mark_from called from do_local_mark if WRAP_MARK_SOME
Ivan Maidanski [Mon, 18 Sep 2017 07:54:37 +0000 (10:54 +0300)]
Fix SIGSEGV in mark_from called from do_local_mark if WRAP_MARK_SOME
(Cherry-pick commits f4d690eb874d02 from 'master' branch.)

Issue #179 (bdwgc).

Parallel marker is disabled (for now) if there is a chance of
scanning unmapped data roots (because GC_do_local_mark is not
prepared to deal with memory protection faults gracefully).

* include/private/gc_pmark.h [HAVE_CONFIG_H]: Do not include config.h
if already included from gc_priv.h (to avoid PARALLEL_MARK macro
redefinition in config.h after it was undefined in gcconfig.h).
* mark.c [MSWIN32 || USE_PROC_FOR_LIBRARIES] (WRAP_MARK_SOME): Move
definition to gcconfig.h.
* include/private/gcconfig.h [WRAP_MARK_SOME && PARALLEL_MARK]
(PARALLEL_MARK): Undefine (as not implemented yet).

7 years agoFix pthread_detach for threads not yet registered (Cygwin, winpthreads)
Ivan Maidanski [Wed, 27 Sep 2017 07:52:09 +0000 (10:52 +0300)]
Fix pthread_detach for threads not yet registered (Cygwin, winpthreads)

* win32_threads.c [GC_PTHREADS] (GC_pthread_detach): Repeat
GC_lookup_pthread() (with a 10 msec delay) while t is null; add comment
and TODO; remove ABORT if t is null (as t is never null after
pthread_detach call).

7 years agoFix pthread_join when thread is registered in thread key destructor
Ivan Maidanski [Tue, 26 Sep 2017 08:44:44 +0000 (11:44 +0300)]
Fix pthread_join when thread is registered in thread key destructor

* pthread_support.c (WRAP_FUNC(pthread_join)): Remove assertion that
thread is finished; call GC_delete_gc_thread only if thread is
finished; add comment.
* win32_threads.c [GC_PTHREADS] (GC_pthread_join): Call
GC_delete_gc_thread_no_free and GC_INTERNAL_FREE only if thread is
finished.

7 years agoFix removal of dead threads in a child process
Ivan Maidanski [Tue, 26 Sep 2017 08:01:29 +0000 (11:01 +0300)]
Fix removal of dead threads in a child process

GC_threads table may contain several elements with the same pthread id,
so GC_remove_all_threads_but_me should remove all elements except for
the first found element matching the id of the current thread.

* pthread_support.c [CAN_HANDLE_FORK] (GC_remove_all_threads_but_me):
Do not assign me if it is already non-null; add comment.
* win32_threads.c [CAN_HANDLE_FORK] (GC_remove_all_threads_but_me):
Likewise.
* win32_threads.c [CAN_HANDLE_FORK] (GC_remove_all_threads_but_me):
Remove GC_ASSERT(me==NULL).

7 years agoFix pthread_join to avoid thread removal on failure (Cygwin, winpthreads)
Ivan Maidanski [Tue, 26 Sep 2017 08:29:54 +0000 (11:29 +0300)]
Fix pthread_join to avoid thread removal on failure (Cygwin, winpthreads)
(Cherry-pick commit 29269f1 from 'release-7_6' branch.)

* win32_threads.c [GC_WIN32_PTHREADS] (GC_pthread_join): Do not call
GC_lookup_pthread if pthread_join failed.
* win32_threads.c [GC_PTHREADS] (GC_pthread_join): Do not call
GC_delete_gc_thread_no_free, GC_INTERNAL_FREE if pthread_join failed.
* win32_threads.c [GC_PTHREADS && DEBUG_THREADS] (GC_pthread_join):
Log whether pthread_join succeeded or failed.

7 years agoFix double lock in pthread_detach (Cygwin, winpthreads)
Ivan Maidanski [Mon, 25 Sep 2017 22:12:30 +0000 (01:12 +0300)]
Fix double lock in pthread_detach (Cygwin, winpthreads)

* win32_threads.c [GC_PTHREADS] (GC_pthread_detach): Do not hold the
allocation lock when GC_lookup_pthread is invoked.

7 years agoFix assertion violation in return_single_freelist in child process
Ivan Maidanski [Mon, 28 Aug 2017 08:26:51 +0000 (11:26 +0300)]
Fix assertion violation in return_single_freelist in child process
(Cherry-pick commit cc6d375 from 'release-7_6' branch.)

Issue #171 (bdwgc).

GC_destroy_thread_local cannot be called from a thread other than
the current one.

* pthread_support.c [CAN_HANDLE_FORK && THREAD_LOCAL_ALLOC]
(GC_remove_all_threads_but_me): Do not call GC_destroy_thread_local;
add comment.
* win32_threads.c [CAN_HANDLE_FORK && THREAD_LOCAL_ALLOC]
(GC_remove_all_threads_but_me): Likewise.
* thread_local_alloc.c [THREAD_LOCAL_ALLOC] (GC_destroy_thread_local):
Update comment.

7 years agoFix GC_remove_specific invocation from remove_all_threads_but_me
Ivan Maidanski [Mon, 28 Aug 2017 06:27:07 +0000 (09:27 +0300)]
Fix GC_remove_specific invocation from remove_all_threads_but_me
(Cherry-pick commit 3d85c61 from 'release-7_6 branch.)

* include/private/specific.h (GC_remove_specific): Define as macro
(calls GC_remove_specific_after_fork).
* include/private/specific.h (GC_remove_specific_after_fork): New
GC_INNER function declaration.
* include/private/thread_local_alloc.h [USE_PTHREAD_SPECIFIC
|| USE_COMPILER_TLS || USE_WIN32_COMPILER_TLS || USE_WIN32_SPECIFIC]
(GC_remove_specific_after_fork): New macro (defined to no-op).
* pthread_support.c [CAN_HANDLE_FORK && THREAD_LOCAL_ALLOC]
(GC_remove_all_threads_but_me): Call GC_remove_specific_after_fork
instead of GC_remove_specific (i.e. delete thread-specific control data
for the given thread instead of the current one).
* win32_threads.c [CAN_HANDLE_FORK && THREAD_LOCAL_ALLOC] Like
* specific.c [USE_CUSTOM_SPECIFIC] (GC_setspecific): Add assertion that
the allocation lock is held; remove the corresponding comment.
* specific.c [USE_CUSTOM_SPECIFIC] (GC_remove_specific): Replace to
GC_remove_specific_after_fork (add t argument); replace self local
variable with t argument; update comment;
* specific.c [USE_CUSTOM_SPECIFIC && CAN_HANDLE_FORK]
(GC_remove_specific_after_fork): Add assertion that the allocation lock
is held; add comment.

7 years agoFix thread id leaks in subthread_create and threadkey_test
Ivan Maidanski [Tue, 19 Sep 2017 22:23:43 +0000 (01:23 +0300)]
Fix thread id leaks in subthread_create and threadkey_test
(Cherry-pick commit 7574e33 from 'release-7_6' branch.)

* tests/subthread_create.c [GC_PTHREADS] (entry): Call pthread_detach
for the created thread.
* tests/threadkey_test.c (main): Likewise.
* tests/threadkey_test.c (on_thread_exit_inner): New local variable
attr; call pthread_attr_init and pthread_attr_setdetachstate;
pass attr to GC_pthread_create; call pthread_attr_destroy.

7 years agoFix missing new-line at format strings end in subthread_create test
Ivan Maidanski [Tue, 19 Sep 2017 22:08:04 +0000 (01:08 +0300)]
Fix missing new-line at format strings end in subthread_create test

* tests/subthread_create.c [GC_PTHREADS] (entry, main): Append "\n" to
fprintf() format string (where missing).

7 years agoFix USE_GET_STACKBASE_FOR_MAIN definition in gcconfig.h
Ivan Maidanski [Mon, 18 Sep 2017 22:07:45 +0000 (01:07 +0300)]
Fix USE_GET_STACKBASE_FOR_MAIN definition in gcconfig.h

* include/private/gcconfig.h [PLATFORM_ANDROID && !THREADS]
(USE_GET_STACKBASE_FOR_MAIN): Move definition down to be after THREADS
definition.

7 years agoFix typo in 'scale' documentation file
Ivan Maidanski [Wed, 30 Aug 2017 23:12:06 +0000 (02:12 +0300)]
Fix typo in 'scale' documentation file
(Cherry-pick commit c875884 from 'master' branch.)

* doc/scale.html (Options for enhanced scalability): Fix a typo
("be replaced").

7 years agoFix printf arguments type in print_callers
Ivan Maidanski [Tue, 29 Aug 2017 22:17:08 +0000 (01:17 +0300)]
Fix printf arguments type in print_callers

* os_dep.c [NEED_CALLINFO] (GC_print_callers): Cast info[i].ci_pc to
unsigned long in GC_err_printf call to match the format specifier.

7 years agoFix deadlock in GC_help_marker caused by use of mark_cv of parent process
Ivan Maidanski [Tue, 22 Aug 2017 08:23:27 +0000 (11:23 +0300)]
Fix deadlock in GC_help_marker caused by use of mark_cv of parent process
(Cherry-pick commit 9b7ef4d from 'release-7_6' branch.)

The marker threads of the parent process are blocked on mark_cv at
fork.  So pthread_cond_wait() malfunction (hang) is possible in the
child process without mark_cv state cleanup (reinitialization).

* pthread_support.c [PARALLEL_MARK] (mark_cv): Move static variable
definition upper to be before start_mark_threads).
* win32_threads.c [GC_PTHREADS_PARAMARK] (mark_cv): Likewise.
* pthread_support.c [PARALLEL_MARK && CAN_HANDLE_FORK] (mark_cv):
Do not initialize statically; add comment.
* win32_threads.c [GC_PTHREADS_PARAMARK && CAN_HANDLE_FORK] (mark_cv):
Likewise.
* pthread_support.c [PARALLEL_MARK && CAN_HANDLE_FORK]
(start_mark_threads): Initialize mark_cv to
PTHREAD_COND_INITIALIZER (unless available_markers_m1 <= 0 or
GC_parallel); add comment.
* win32_threads.c [GC_PTHREADS_PARAMARK && CAN_HANDLE_FORK]
(start_mark_threads): Likewise.
* pthread_support.c [PARALLEL_MARK] (GC_wait_marker,
GC_notify_all_marker): Add assertion that GC_parallel is true (so
mark_cv is initialized).
* win32_threads.c [GC_PTHREADS_PARAMARK] (GC_wait_marker,
GC_notify_all_marker): Likewise.

7 years agoAvoid busy waiting in mark_thread while GC_parallel is false
Ivan Maidanski [Tue, 22 Aug 2017 05:56:31 +0000 (08:56 +0300)]
Avoid busy waiting in mark_thread while GC_parallel is false
(Cherry-pick commit 46d2a44 from 'release-7_6' branch.)

* mark.c [PARALLEL_MARK] (GC_help_marker): Add assertion that
GC_parallel is true (i.e. GC_markers_m1 is non-zero).
* pthread_support.c [PARALLEL_MARK && CAN_HANDLE_FORK]
(start_mark_threads): Set GC_markers_m1 value before starting
the first marker thread (it is already set if fork handling is off).
* win32_threads.c [GC_PTHREADS_PARAMARK && CAN_HANDLE_FORK]
(start_mark_threads): Likewise.
* pthread_support.c [PARALLEL_MARK] (start_mark_threads):
Adjust GC_markers_m1 value only if pthread_create failed.
* win32_threads.c [GC_PTHREADS_PARAMARK] (start_mark_threads):
Likewise.

7 years agoFix hb_n_marks underflow in clear_fl_marks if MARK_BIT_PER_OBJ
Ivan Maidanski [Sat, 19 Aug 2017 15:22:37 +0000 (18:22 +0300)]
Fix hb_n_marks underflow in clear_fl_marks if MARK_BIT_PER_OBJ

Issue #177 (bdwgc).

* mark.c [MARK_BIT_PER_OBJ] (GC_set_hdr_marks): Set hhdr->hb_n_marks
exactly to n_marks value (without a decrement by one).

7 years agoRemove unused variable in remove_all_threads_but_me
Ivan Maidanski [Thu, 17 Aug 2017 09:08:47 +0000 (12:08 +0300)]
Remove unused variable in remove_all_threads_but_me
(revert commit c2e05dd)

* pthread_support.c [CAN_HANDLE_FORK && THREAD_LOCAL_ALLOC
&& USE_CUSTOM_SPECIFIC] (GC_remove_all_threads_but_me): Remove "res"
local variable.

7 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Thu, 17 Aug 2017 07:54:27 +0000 (10:54 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

7 years agoFix array_mark_proc to request global mark stack growth on overflow
Ivan Maidanski [Wed, 9 Aug 2017 08:35:25 +0000 (11:35 +0300)]
Fix array_mark_proc to request global mark stack growth on overflow
(fix commit 3f06655)

* typd_mlc.c [PARALLEL_MARK] (GC_array_mark_proc): Set
GC_mark_stack_too_small to true if GC_push_complex_descriptor()
returned null and mark_stack_limit belongs to the global mark stack
(even if GC_parallel is true).

7 years agoFix leak_test crash in print_callers if free() is redirected
Ivan Maidanski [Mon, 7 Aug 2017 08:37:30 +0000 (11:37 +0300)]
Fix leak_test crash in print_callers if free() is redirected

* dbg_mlc.c [REDIRECT_MALLOC && (GC_LINUX_THREADS || GC_SOLARIS_THREADS
|| MSWIN32 || NEED_CALLINFO && GC_HAVE_BUILTIN_BACKTRACE)]
(GC_debug_free): If the object is not in the GC heap then just return
(instead of ABORT).
* malloc.c [REDIRECT_MALLOC && NEED_CALLINFO
&& GC_HAVE_BUILTIN_BACKTRACE] (GC_free): If hhdr is null (i.e. the
object is not in the GC heap) then return without the object
deallocation; add comment.
* os_dep.c [NEED_CALLINFO && GC_HAVE_BUILTIN_BACKTRACE
&& !GC_BACKTRACE_SYMBOLS_BROKEN] (GC_print_callers): Adjust comment
for free().

7 years agoFix undefined HEAP_START in register_dynamic_libraries
Ivan Maidanski [Wed, 2 Aug 2017 21:37:09 +0000 (00:37 +0300)]
Fix undefined HEAP_START in register_dynamic_libraries

* include/private/gcconfig.h [!HEAP_START] (HEAP_START): Define to 0 by
default (if not previously defined in the file).
* os_dep.c (HEAP_START): Remove.

7 years agoFix bytes count passed to add_to_our_memory in backgraph new_back_edges
Ivan Maidanski [Wed, 2 Aug 2017 08:13:23 +0000 (11:13 +0300)]
Fix bytes count passed to add_to_our_memory in backgraph new_back_edges
(fix commit 180b56c)

* backgraph.c [MAKE_BACK_GRAPH] (new_back_edges): Pass bytes_to_get to
GC_add_to_our_memory() (i.e. pass the same number of bytes as passed
to GET_MEM() even in case of MMAP_SUPPORTED).

7 years agoFix GC_incremental declaration/definition type mismatch
Ivan Maidanski [Fri, 21 Jul 2017 17:59:55 +0000 (20:59 +0300)]
Fix GC_incremental declaration/definition type mismatch

* alloc.c [!GC_DISABLE_INCREMENTAL] (GC_incremental): Change variable
type from int to GC_bool (to match that of the declaration in
gc_priv.h).

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 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 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 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: Test --disable-munmap
Ivan Maidanski [Thu, 29 Jun 2017 18:23:10 +0000 (21:23 +0300)]
Travis CI: Test --disable-munmap
(Cherry-pick commit 6977d30 from 'master' branch.)

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
(Cherry-pick commit 1505f15 from 'master' branch.)

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
(Cherry-pick commit 1e89d43 from 'master' branch.)

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"
(Cherry-pick commit 25293f6 from 'master' branch.)

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
(Cherry-pick commit bf77565 from 'master' branch.)

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
(Cherry-pick commit 457297d from 'release-7_6' branch.)

* 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 && CAN_HANDLE_FORK]
(GC_dirty_init): Replace GC_COND_LOG_PRINTF() with WARN()
which is called before return; refine WARN message.
* 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 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 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 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 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 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 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 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 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
(Cherry-pick commit 1b632a2 from 'release-7_6' branch.)

* 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 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 agoPrevent abort in register_data_segments for Symbian
Ivan Maidanski [Tue, 20 Jun 2017 14:05:20 +0000 (17:05 +0300)]
Prevent abort in register_data_segments for Symbian
(Cherry-pick commit a706784 from 'release-7_6' branch.)

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] (DATASTART,
DATAEND): Change to a non-null value (ALIGNMENT).

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 agoFix configure --disable-munmap handling
Ivan Maidanski [Thu, 29 Jun 2017 18:19:33 +0000 (21:19 +0300)]
Fix configure --disable-munmap handling
(Cherry-pick commit cb66553 from 'master' branch.)

* configure.ac (USE_MUNMAP, MUNMAP_THRESHOLD): Do not define if
enable_munmap is "no" (or a blank value).

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)
(Cherry-pick commit 6562982 from 'release-7_6' branch.)

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 (add Hamayama)
Ivan Maidanski [Tue, 20 Jun 2017 08:58:15 +0000 (11:58 +0300)]
Update AUTHORS file (add Hamayama)

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 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
(Cherry-pick commit ddde4e5 from 'release-7_6' branch.)

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 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)
(Cherry-pick commit 3300086 from 'release-7_6' branch.)

* 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 (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 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 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 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: 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
(Cherry-pick commit b6f43d8 from 'master' branch.)

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'
(Cherry-pick commits e2f72bd062bf62 from 'master' branch.)

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: Test also with mingw-w64 32/64-bit cross-compilers
Ivan Maidanski [Wed, 5 Apr 2017 20:49:23 +0000 (23:49 +0300)]
Travis CI: Test also with mingw-w64 32/64-bit cross-compilers
(Cherry-pick commit 70bb040 from 'master' branch.)

7 years agoTravis CI: Test also the distributive file creation
Ivan Maidanski [Thu, 27 Apr 2017 09:03:43 +0000 (12:03 +0300)]
Travis CI: Test also the distributive file creation
(Cherry-pick commit b785b43 from 'master' branch.)

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
(Cherry-pick commit 77afa79a from 'master' branch.)

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 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
(Cherry-pick commit dbe2151 from 'master' branch.)