* 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.
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.
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.
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).
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).
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.
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.
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__.
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.
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.
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).
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.
Ivan Maidanski [Fri, 5 May 2017 18:04:25 +0000 (21:04 +0300)]
Update documentation as parallel mark is now on by default in configure
(fix commit c7f2147)
* configure.ac (parallel-mark): Provide information about
--disable-parallel-mark option instead of --enable-parallel-mark.
* doc/README.autoconf (Important options): Likewise.
* doc/README.solaris2: Likewise.
* doc/simple_example.html: Likewise.
* doc/README.DGUX386: Remove configure --enable-parallel-mark option
(as it is on by default now).
* doc/README.autoconf (Important options): Do not provide information
about --enable-full-debug which is no longer supported (since v7.0).
* doc/gcinterface.html: update information about parallel marker mode
in configure.
* doc/README.solaris2: Provide information about --disable-threads
option instead of --enable-threads=posix.
* doc/simple_example.html: Likewise.
Ivan Maidanski [Thu, 4 May 2017 11:17:37 +0000 (14:17 +0300)]
Align IRIX/OSF1_THREADS definition in gc_config_macros.h with gcconfig.h
The condition of defining GC_IRIX_THREADS and GC_OSF1_THREADS
(if GC_THREADS) in gc_config_macros.h is now the same as that of
IRIX5 and OSF1 macros in gcconfig.h, respectively.
* include/gc_config_macros.h [GC_THREADS] (GC_HPUX_THREADS,
GC_SOLARIS_THREADS): Replace !defined(__linux__) with "#elif".
* include/gc_config_macros.h [GC_THREADS] (GC_OPENBSD_THREADS,
GC_FREEBSD_THREADS, GC_NETBSD_THREADS): Handle the case before
GC_OSF1_THREADS, GC_IRIX_THREADS, GC_SOLARIS_THREADS, GC_DARWIN_THREADS;
remove FIXME.
* include/gc_config_macros.h [GC_THREADS] (GC_IRIX_THREADS): Check
mips and _mips predefined macros in addition to __mips; do not define
if any of [_]nec_ews, [__]ultrix predefined macro is defined.
Ivan Maidanski [Thu, 27 Apr 2017 07:56:08 +0000 (10:56 +0300)]
Update GC compilation and usage notes for Win32
* doc/README.win32: Remove note that cord test is not ported; do not
refer to GC 6.1alpha4.
* doc/README.win32 (Microsoft Tools): Eliminate gctest description
duplication; remove outdated note that static library is normal in
case of absence of thread support.
* doc/README.win32 (GNU Tools): Add note that MinGW build could be
performed on a Windows host; update information about parallel marker
(it is on by default now).
* doc/README.win32 (Threads): Update information about the default
status of threads support in ./configure; mention CMakeLists.txt as
well; refine information about pthread_create/exit calls in Cygwin;
refine information about GC_CreateThread and GC_INIT.
Ivan Maidanski [Sat, 22 Apr 2017 15:21:09 +0000 (18:21 +0300)]
Turn on parallel marker by default for all multi-threaded builds
Note: if some target does not support PARALLEL_MARK, it should be
fixed (or a workaround should be added).
* CMakeLists.txt (enable_parallel_mark): Change default value to ON.
* CMakeLists.txt [enable_parallel_mark] (PARALLEL_MARK): Define only
along with GC_LINUX_THREADS, or GC_AIX_THREADS, or GC_HPUX_THREADS, or
GC_OPENBSD_THREADS, or GC_FREEBSD_THREADS, or GC_NETBSD_THREADS, or
GC_SOLARIS_THREADS, or GC_IRIX_THREADS, or GC_THREADS, or
GC_DARWIN_THREADS, or GC_OSF1_THREADS.
* configure.ac (PARALLEL_MARK): Always define unless threads are
disabled or enable_parallel_mark is "no".
Ivan Maidanski [Fri, 21 Apr 2017 21:28:35 +0000 (00:28 +0300)]
Eliminate 'possible loss of data' MS VC warning in disclaim_and_reclaim
* reclaim.c [ENABLE_DISCLAIM] (GC_disclaim_and_reclaim): Change type
of bit_no local variable from int to word (matching that in other
GC_reclaim_* functions).
Ivan Maidanski [Fri, 21 Apr 2017 10:24:42 +0000 (13:24 +0300)]
Collapse multiple NT_*_MAKEFILE scripts into a single NT_MAKEFILE
Now NT_MAKEFILE should support building of static and dynamic,
single- and multi-threaded, 32- and 64-bit GC libraries.
The default is dynamic multi-threaded GC library.
* NT_MAKEFILE: Remove comment about assuming a single thread.
* NT_MAKEFILE (MY_CPU): Replace with CVTRES_CPU; add comment; add
sample for X64.
* NT_MAKEFILE (CPU): Comment out (defined automatically).
* NT_MAKEFILE (CFLAGS_SPECIFIC, GC_DLL, GC_LIB, LINK_GC): New variable;
add samples for X64, static, single-threaded library.
* NT_MAKEFILE (LINK_DLL_FLAGS): New variable (copied from LINK64_FLAGS
of NT_X64_THREADS_MAKEFILE file); remove unneeded system .lib files.
* NT_MAKEFILE (AO_SRC_DIR, AO_INCLUDE_DIR): New variable (copied from
NT_STATIC_THREADS_MAKEFILE file).
* NT_MAKEFILE (OBJS): Add win32_threads.obj, thread_local_alloc.obj.
* NT_MAKEFILE (.c.obj, .cpp.obj): Add -I$(AO_INCLUDE_DIR) option;
replace $(cvars) with $(CFLAGS_SPECIFIC); add /wd4100 /wd4127 /wd4701
options (copied from NT_X64_THREADS_MAKEFILE).
* NT_MAKEFILE (.c.obj): Add -DCORD_NOT_DLL option (copied from
NT_X64_THREADS_MAKEFILE); Add comment about _CRT_SECURE_NO_DEPRECATE
(copied from NT_X64_STATIC_THREADS_MAKEFILE file).
* NT_MAKEFILE (gc_cpp.cpp): Remove target.
* NT_MAKEFILE (gc.lib, gctest.exe, cord\de.exe, test_cpp.exe): Replace
gc.lib with $(GC_LIB).
* NT_MAKEFILE (gc.lib): Replace "lib /MACHINE:i386 /out:gc.lib" with
"$(LINK_GC) /MACHINE:$(CPU)"; remove comment about original NT SDK.
* NT_MAKEFILE (gctest.exe): Remove comments related to win32s.
* NT_MAKEFILE (gctest.exe, cord\de.exe, test_cpp.exe): Replace
"-debug -debugtype:cv" options with $(ldebug).
* NT_MAKEFILE ($(AO_SRC_DIR), clean): New target (copied from
NT_X64_THREADS_MAKEFILE file).
* NT_STATIC_THREADS_MAKEFILE: Remove.
* NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_THREADS_MAKEFILE: Likewise.
Ivan Maidanski [Thu, 20 Apr 2017 08:50:03 +0000 (11:50 +0300)]
Eliminate 'possible loss of data' compiler warnings in cord (MS VC)
* cord/cordbscs.c (CORD_cat_char_star, CORD_cat, CORD_from_fn_inner):
Add explicit cast in assignment of result->depth, result->len.
* cord/cordbscs.c (CORD_substr_checked): Change type of "j", "lim"
local variables from int to size_t.
* cord/cordbscs.c (CORD_init_min_len): Add explicit cast (to int) in
assignment of CORD_max_len.
* cord/cordxtra.c (CORD_ncmp): Add explicit cast (to long) when "avail"
local variable is updated.
* cord/cordxtra.c (CORD_chr, CORD_rchr, CORD_from_file_eager): Add
explicit cast to char (from int) for "c" local variable in assignment
of d.target and in CORD_ec_append call.
* cord/cordxtra.c (refill_cache): Add explicit cast to long (from
size_t) for line_start in fseek call.
* cord/tests/de.c (line_pos, fix_pos, do_command): Add explicit cast to
int in assignment of *c, line, col.
* cord/tests/de.c (do_command): Reset line, col and file_pos variables
(of different types) in separate statements.
* cord/tests/de_win.c (WinMain): Add explicit cast of msg.wParam to int
in return statement.
Ivan Maidanski [Wed, 19 Apr 2017 08:43:36 +0000 (11:43 +0300)]
Remove version info in 'de' cord test application
This version (4.1) is outdated and not needed (as it is a test app).
* cord/tests/de_win.rc (ABOUTBOX): Remove information about "de" test
application version.
* cord/tests/de_win.rc: Remove the commented out description adding
"de" icon.
Ivan Maidanski [Thu, 13 Apr 2017 16:19:00 +0000 (19:19 +0300)]
Eliminate 'incompatible function pointer' warning in mark_some (MinGW/x86)
* include/private/gc_priv.h [__MINGW32__ && __i386__ && GC_EXTERN]
(__MINGW_EXCPT_DEFINE_PSDK): Define (before any system header include);
this macro definition is needed only when extra/gc.c is compiled.
* mark.c [__MINGW32__ && __i386__] (__MINGW_EXCPT_DEFINE_PSDK): Define
(before include gc_pmark.h).