]> granicus.if.org Git - gc/log
gc
5 years agoAdjust highlighting of API prototypes in gcinterface.md
Ivan Maidanski [Tue, 26 Mar 2019 21:31:25 +0000 (00:31 +0300)]
Adjust highlighting of API prototypes in gcinterface.md

* doc/gcinterface.md: Properly highlight listed API functions
(GC_MALLOC, GC_MALLOC_ATOMIC, GC_MALLOC_UNCOLLECTABLE, GC_REALLOC,
GC_FREE, GC_MALLOC_IGNORE_OFF_PAGE, GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE,
GC_INIT, GC_gcollect, GC_enable_incremental, GC_set_warn_proc,
GC_REGISTER_FINALIZER).

5 years agoFix a typo in gcinterface.md after recent documentation update
Ivan Maidanski [Tue, 26 Mar 2019 20:28:18 +0000 (23:28 +0300)]
Fix a typo in gcinterface.md after recent documentation update
(fix of commit 6f8f39af5)

* doc/gcinterface.md (GC_MALLOC_IGNORE_OFF_PAGE): Fix a typo
("inheritance").

5 years agoFix printf format specifier in simple_example.md
Ivan Maidanski [Tue, 26 Mar 2019 20:09:49 +0000 (23:09 +0300)]
Fix printf format specifier in simple_example.md

* doc/simple_example.md (Writing the program): Adjust printf format
specifier to match the argument type.

5 years agoReformat gc.man (wrap long lines)
Ivan Maidanski [Tue, 26 Mar 2019 06:27:22 +0000 (09:27 +0300)]
Reformat gc.man (wrap long lines)

* doc/gc.man: Wrap lines longer than 78 characters.

5 years agoUpdate the documentation to match the current GC implementation
Ivan Maidanski [Tue, 26 Mar 2019 05:37:11 +0000 (08:37 +0300)]
Update the documentation to match the current GC implementation

* README.md: Update the documentation to match the current
implementation of the collector.
* doc/README.Mac: Likewise.
* doc/README.autoconf: Likewise.
* doc/README.darwin: Likewise.
* doc/README.hp: Likewise.
* doc/README.linux: Likewise.
* doc/README.macros: Likewise.
* doc/README.solaris2: Likewise.
* doc/README.win32: Likewise.
* doc/debugging.md: Likewise.
* doc/finalization.md: Likewise.
* doc/gc.man: Likewise.
* doc/gcdescr.md: Likewise.
* doc/gcinterface.md: Likewise.
* doc/leak.md: Likewise.
* doc/overview.md: Likewise.
* doc/porting.md: Likewise.
* doc/scale.md: Likewise.

5 years agoAdjust formatting of numbered lists in README.md to match other .md files
Ivan Maidanski [Mon, 25 Mar 2019 15:50:26 +0000 (18:50 +0300)]
Adjust formatting of numbered lists in README.md to match other .md files

* README.md (Installation and Portability,
The C Interface to the Allocator, Incremental/Generational Collection):
Reformat numbered lists.

5 years agoFix incorrect markup formatting in documentation
Ivan Maidanski [Mon, 25 Mar 2019 13:51:37 +0000 (16:51 +0300)]
Fix incorrect markup formatting in documentation

* doc/gcdescr.md (Mark phase): Terminate list at a proper sentence.
* doc/leak.md: Likewise.
* doc/scale.md (Performance): Fix markup table format.

5 years agoFix configure message about 'AIX gcc optimization fix'
Ivan Maidanski [Sun, 24 Mar 2019 09:03:01 +0000 (12:03 +0300)]
Fix configure message about 'AIX gcc optimization fix'

* configure.ac [$host=*aix*]: Update comment and AC_MSG_CHECKING
message to match the checked condition.

5 years agoRefine GC_INIT documentation about its multiple invocation
Ivan Maidanski [Sun, 24 Mar 2019 08:30:40 +0000 (11:30 +0300)]
Refine GC_INIT documentation about its multiple invocation

* include/gc.h (GC_INIT): Add comment about GC_INIT() multiple calls.

5 years agoRemove 'distributed ports', 'scalable versions' sections from overview.md
Ivan Maidanski [Fri, 22 Mar 2019 21:15:53 +0000 (00:15 +0300)]
Remove 'distributed ports', 'scalable versions' sections from overview.md

* doc/overview.md (Separately distributed ports,
Scalable multiprocessor versions): Remove.

5 years agoRemove 'current users' section from overview.md
Ivan Maidanski [Fri, 22 Mar 2019 21:02:55 +0000 (00:02 +0300)]
Remove 'current users' section from overview.md

Information about known BDWGC clients is moved to
https://github.com/ivmai/bdwgc/wiki/Known-clients

* doc/overview.md (Current users): Remove section.
* doc/overview.md (Information provided on the BDWGC site): Add a link
to the list of known clients.

5 years agoUpdate the ASCII diagrams describing the tree structure for pointer lookups
Ivan Maidanski [Fri, 22 Mar 2019 17:23:47 +0000 (20:23 +0300)]
Update the ASCII diagrams describing the tree structure for pointer lookups

* doc/tree.md (A picture): Update the Dave Barrett's ASCII diagrams
(from v3.7, 1994) to match the current BDWGC version.

5 years agoUse KB/MB/GB abbreviations uniformly across entire documentation
Ivan Maidanski [Fri, 22 Mar 2019 16:44:35 +0000 (19:44 +0300)]
Use KB/MB/GB abbreviations uniformly across entire documentation

* README.md (Installation and Portability): Precede MB with a space.
* doc/README.amiga (WHATS NEW): Likewise.
* doc/debugging.md: Likewise.
* README.md (The C Interface to the Allocator): Replace Kbytes to KB.
* doc/gc.man: Likewise.
* README.Mac: Replace k to KB with a preceding space.
* doc/debugging.md: Likewise.
* doc/README.amiga: Precede MHz with a space.
* doc/debugging.md: Precede KB with a space.
* include/gc.h (GC_malloc_ignore_off_page): Replace K to KB with
a preceding space in a comment.
* tests/test.c (BIG): Likewise.
* include/private/gc_priv.h (ALL_INTERIOR_POINTERS, HBLKSIZE,
CPP_LOG_HBLKSIZE, LOG_PHT_ENTRIES): Likewise.
* include/private/gc_priv.h (LOG_PHT_ENTRIES): Replace M to MB with
a preceding space in a comment.
* include/private/gc_priv.h (LOG_PHT_ENTRIES): Replace G to GB with
a preceding space in a comment.
* os_dep.c [GC_USE_MEM_TOP_DOWN && USE_WINALLOC] (GC_mem_top_down):
Likewise.
* include/gc_priv.h (GC_printf): Replace k to KB with a preceding
space in a comment.
* include/private/specific.h (quick_thread_id): Likewise.
* os_dep.c [MSWINCE] (GC_wince_get_mem): Likewise.
* os_dep.c [USE_WINALLOC && !MSWIN_XBOX1 || CYGWIN32]
(GC_win32_get_mem): Likewise.
* include/private/gcconfig.h [I386 && LINUX] (HEAP_START): Precede GB
with a space in a comment.

5 years agoFix various typos mostly in documentation files
Ivan Maidanski [Fri, 22 Mar 2019 07:04:52 +0000 (10:04 +0300)]
Fix various typos mostly in documentation files

* OS2_MAKEFILE: Fix a typo in comment ("it is there").
* README.md: Fix typos ("is not", "gc_inline.h", "bytes from",
"processed").
* doc/README.OS2: Fix typos ("how", "linking").
* doc/README.amiga: Fix typos ("GC", "e.g.", "GC_*_typed", "i.e.",
"SMakefile.amiga", "communications").
* doc/README.cmake: Fix a typo ("go to").
* doc/README.ews4800: Fix a typo ("a unique").
* doc/README.solaris2: Fix a typo ("toolchain").
* doc/finalization.md: Fix incorrect number of markup '#' symbols to
denote H2 header.
* doc/overview.md: Likewise.
* doc/gcdescr.md: Fix typos ("collects", "then advances", "is not",
"treated by").
* doc/gcinterface.md: Fix typos ("Build it", "Allocates",
"deallocates", "forces", "Causes", "Replaces", "Registers",
"traceable_alloc", "single_client_traceable_alloc").
* doc/leak.md: Fix typos ("there is", "provides").
* doc/overview.md (Further reading): Replace "&" with "and".
* doc/porting.md: Add missing ")" symbol; add missing comma; fix typos
("region_start", "region_end", "collector's", "are needed",
"GC_save_callers").
* include/private/gc_priv.h: Fix a typo in comment ("gc_inline.h").
* os_dep.c [GWW_VDB] (detect_GetWriteWatch, GC_gww_read_dirty): Fix
abbreviation ("Win2K") in a comment.
* os_dep.c [MSWIN32] (GC_wnt): Likewise.
* os_dep.c [GWW_VDB] (GC_gww_read_dirty): Fix a typo in comment
("behavior").

5 years agoTravis CI: Do not scan real_malloc.c to workaround cppcheck false positive
Ivan Maidanski [Thu, 21 Mar 2019 08:15:39 +0000 (11:15 +0300)]
Travis CI: Do not scan real_malloc.c to workaround cppcheck false positive

cppcheck reports "Allocation with malloc, return doesn't release it"
error (which is a false positive) in real_malloc().

5 years agoRemove documentation specific to particular old BDWGC releases
Ivan Maidanski [Thu, 21 Mar 2019 07:43:12 +0000 (10:43 +0300)]
Remove documentation specific to particular old BDWGC releases

* doc/README.Mac: Remove mentioning of particular GC versions; adjust
the information (if needed) to match the current GC functionality.
* doc/README.amiga: Likewise.
* doc/README.arm.cross: Likewise.
* doc/README.autoconf: Likewise.
* doc/README.linux: Likewise.
* doc/README.macros (FINALIZE_ON_DEMAND, JAVA_FINALIZATION): Likewise.
* doc/README.sgi: Likewise.
* doc/README.solaris2 (SOLARIS THREADS): Likewise.
* doc/README.symbian: Likewise.
* doc/README.win32 (Threads): Likewise.
* doc/README.win64: Likewise.
* doc/gcdescr.md (Allocation, Thread support,
Thread-local allocation): Likewise.
* doc/gcinterface.md (GC_INIT): Likewise.
* doc/leak.md: Likewise.
* doc/porting.md (Additional requirements for a basic port,
Thread support): Likewise.
* doc/scale.md (Options for enhanced scalability, Performance):
Likewise.
* doc/simple_example.md (Debugging): Do not mention removed
`--enable-full-debug` option of configure.
* include/gc.h (GC_parallel, GC_dont_gc, GC_use_entire_heap,
GC_set_handle_fork): Remove comment that the behavior has changed in
a particular GC version.
* include/gc_inline.h (GC_MALLOC_WORDS_KIND): Likewise.
* include/gc.h (GC_set_free_space_divisor, GC_warn_proc): Reword
comment about ABI incompatible change in some GC version.
* include/gc.h (GC_get_heap_usage_safe): Remove comment that the API
was introduced in a particular GC version.
* include/gc_cpp.h (UseGC): Likewise.
* os_dep.c [LINUX_STACKBOTTOM && IA64] (GC_get_register_stack_base):
Remove mentioning of a particular GC version (and of an old behavior
on an ancient kernel) in a comment.
* win32_threads.c [!GC_PTHREADS && !GC_NO_THREADS_DISCOVERY]
(GC_DllMain): Likewise.
* OS2_MAKEFILE: Likewise.

5 years agoRemove unused sparc_sunos4_mach_dep.s file
Ivan Maidanski [Wed, 20 Mar 2019 07:42:52 +0000 (10:42 +0300)]
Remove unused sparc_sunos4_mach_dep.s file

Issue #269 (bdwgc).

It had been used only by OpenBSD/sparc in Makefile.direct previously.

* Makefile.am (EXTRA_libgc_la_SOURCES): Remove sparc_sunos4_mach_dep.s.
* Makefile.direct (SRCS): Likewise.
* sparc_sunos4_mach_dep.s: Remove file.

5 years agoUpdate AUTHORS file (add Alaskan Emily)
Ivan Maidanski [Wed, 20 Mar 2019 07:31:49 +0000 (10:31 +0300)]
Update AUTHORS file (add Alaskan Emily)

5 years agoFix compiling by Makefile.direct on OpenBSD/UltraSparc
Alaskan Emily [Fri, 15 Mar 2019 04:07:13 +0000 (21:07 -0700)]
Fix compiling by Makefile.direct on OpenBSD/UltraSparc

Issue #269 (bdwgc).

* Makefile.direct (mach_dep.o): Remove sparc_sunos4_mach_dep.s
dependency.
* Makefile.direct [SPARC OPENBSD] (mach_dep.o): Use $CC instead of $AS;
compile sparc_mach_dep.S instead of sparc_sunos4_mach_dep.s.

5 years agoUpdate copyright information (year) in alloc.c and README.QUICK
Ivan Maidanski [Wed, 20 Mar 2019 06:57:40 +0000 (09:57 +0300)]
Update copyright information (year) in alloc.c and README.QUICK

* README.QUICK (Copyright): Update year (2018 to 2019).
* alloc.c (Copyright): Likewise.
* alloc.c (GC_copyright): Update copyright year.

5 years agoSupport MSYS builds by CMake
Ivan Maidanski [Wed, 20 Mar 2019 06:23:45 +0000 (09:23 +0300)]
Support MSYS builds by CMake

* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && HOST=.*-.*-msys.*]
(GC_THREADS, _REENTRANT): Define macro.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && HOST=.*-.*-msys.*
&& enable_parallel_mark] (PARALLEL_MARK): Likewise.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && HOST=.*-.*-msys.*
&& enable_thread_local_alloc] (THREAD_LOCAL_ALLOC): Likewise.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && HOST=.*-.*-msys.*
&& enable_thread_local_alloc] (SRC): Add thread_local_alloc.c.
* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && HOST=.*-.*-msys.*] (SRC):
Add win32_threads.c.

5 years agoUpdate AUTHORS file (add Peter Budai)
Ivan Maidanski [Wed, 20 Mar 2019 06:15:00 +0000 (09:15 +0300)]
Update AUTHORS file (add Peter Budai)

5 years agoSupport MSYS builds in configure
Peter Budai [Sat, 15 Sep 2018 09:35:20 +0000 (11:35 +0200)]
Support MSYS builds in configure

* configure.ac [$THREADS=pthreads && $host=*-*-msys*] (GC_THREADS,
_REENTRANT): Define AC macro.
* configure.ac [$THREADS=pthreads && $host=*-*-msys*]
(use_parallel_mark, use_thread_local_alloc, THREADDLLIBS,
win32_threads): Set variable.
* configure.ac [$host=*-*-msys*]: Do not AC_CHECK_LIB(dl).
* configure.ac [$GCC=yes && $enable_cplusplus=yes && $host=*-*-msys*
&& $SUPC!="libsupc++.a"] (CXXLIBS): Set variable.

5 years agoUpdate AUTHORS file (add Richard Zidlicky)
Ivan Maidanski [Tue, 19 Mar 2019 19:54:11 +0000 (22:54 +0300)]
Update AUTHORS file (add Richard Zidlicky)

5 years agowindows-untested: Update after include/gc_inl.h removal
Ivan Maidanski [Tue, 19 Mar 2019 19:46:30 +0000 (22:46 +0300)]
windows-untested: Update after include/gc_inl.h removal

5 years agoUpdate ChangeLog file
Ivan Maidanski [Sat, 2 Mar 2019 07:20:42 +0000 (10:20 +0300)]
Update ChangeLog file

5 years agoUpdate ChangeLog file (v8.0 changes)
Ivan Maidanski [Fri, 1 Mar 2019 21:47:38 +0000 (00:47 +0300)]
Update ChangeLog file (v8.0 changes)

5 years agoUpdate ChangeLog file (set v7.4.18 release date)
Ivan Maidanski [Fri, 1 Mar 2019 16:39:55 +0000 (19:39 +0300)]
Update ChangeLog file (set v7.4.18 release date)

5 years agoUpdate ChangeLog file (set v7.2n release date)
Ivan Maidanski [Fri, 1 Mar 2019 07:26:55 +0000 (10:26 +0300)]
Update ChangeLog file (set v7.2n release date)

5 years agoAppVeyor CI: Log pid of gctest forked processes (cygwin)
Ivan Maidanski [Thu, 28 Feb 2019 18:21:31 +0000 (21:21 +0300)]
AppVeyor CI: Log pid of gctest forked processes (cygwin)

5 years agoRemove dash characters comprising prefix of some verbose logs (gctest)
Ivan Maidanski [Thu, 28 Feb 2019 18:07:48 +0000 (21:07 +0300)]
Remove dash characters comprising prefix of some verbose logs (gctest)

* tests/test.c (run_one_test): Remove a prefix consisting of 13 '-'
characters in logged messages.

5 years agoNew macro (GCTEST_PRINT_VERBOSE) to enable verbose logging in test.c only
Ivan Maidanski [Thu, 28 Feb 2019 17:50:46 +0000 (20:50 +0300)]
New macro (GCTEST_PRINT_VERBOSE) to enable verbose logging in test.c only

* tests/test.c [GCTEST_PRINT_VERBOSE] (print_stats): Define to VERBOSE.

5 years agoPrint pid of child processes if verbose logging (gctest)
Ivan Maidanski [Thu, 28 Feb 2019 17:29:36 +0000 (20:29 +0300)]
Print pid of child processes if verbose logging (gctest)

* tests/test.c [!NO_TEST_HANDLE_FORK] (run_one_test): Print pid of the
forked process (if print_stats).
* tests/test.c [!NO_TEST_HANDLE_FORK && THREADS] (run_one_test): Log
tiny_reverse_test() invocation (if print_stats).

5 years agoAvoid potential race in hb_sz access between realloc and reclaim_block
Ivan Maidanski [Tue, 26 Feb 2019 22:32:53 +0000 (01:32 +0300)]
Avoid potential race in hb_sz access between realloc and reclaim_block

Issue #240 (bdwgc).

GC_realloc might be changing the block size while GC_reclaim_block
is examining it.  The change to the size field is benign, i.e.
GC_reclaim would work correctly with either value, since we are not
changing the number of objects in the block.  But seeing a half-updated
value (though unlikely to occur in practice) could be probably bad.
Using unordered atomic fetch of hb_sz field should solve the issue.

* reclaim.c (GC_block_nearly_full, GC_reclaim_small_nonempty_block):
Add sz argument; use sz instead of hhdr->hb_sz.
* reclaim.c (GC_reclaim_clear, GC_reclaim_uninit, GC_reclaim_check):
Skip the assertion about hhdr->hb_sz if THREADS.
* reclaim.c [ENABLE_DISCLAIM] (GC_disclaim_and_reclaim): Likewise.
* reclaim.c [AO_HAVE_load] (GC_reclaim_block): Use AO_load to access
hhdr->hb_sz; add comments.
* reclaim.c (GC_reclaim_block): Pass sz to
GC_reclaim_small_nonempty_block() and GC_block_nearly_full().
* reclaim.c (GC_continue_reclaim, GC_reclaim_all): Pass hhdr->hb_sz to
GC_reclaim_small_nonempty_block().
* reclaim.c [!EAGER_SWEEP && ENABLE_DISCLAIM]
(GC_reclaim_unconditionally_marked): Likewise.

5 years agoFix 'duplicate symbol' error for tests using multiple static libs (OS X)
Ivan Maidanski [Tue, 26 Feb 2019 21:48:12 +0000 (00:48 +0300)]
Fix 'duplicate symbol' error for tests using multiple static libs (OS X)

Issue #263 (bdwgc).

If configured with --enable-static, libtool passes libgc.a to gcc
twice (with a relative path and with an absolute one) when linking
tests that depend on libcord.a, libgccpp.a or libstaticrootslib_test.a
which, in turn, depends on libgc.a.  Double specification of libgc.a
seems to confuse ld tool of MacOS 10.14.

The workaround is to omit libgc.la in *_LDADD specification of the
mentioned tests when the shared libraries are not requested, at least.

* configure.ac (ENABLE_SHARED): New AM_CONDITIONAL.
* cord/cord.am (cordtest_LDADD): Do not add libgc.la unless
ENABLE_SHARED; add comment.
* tests/tests.am (staticrootstest_LDADD): Likewise.
* tests/tests.am [CPLUSPLUS && !AVOID_CPP_LIB] (test_cpp_LDADD):
Likewise.

5 years ago.gitignore: Ignore /out folder
Ivan Maidanski [Tue, 26 Feb 2019 20:11:29 +0000 (23:11 +0300)]
.gitignore: Ignore /out folder

5 years agoFix assertion violation about the number of freed objects in test_cpp
Ivan Maidanski [Mon, 25 Feb 2019 21:51:45 +0000 (00:51 +0300)]
Fix assertion violation about the number of freed objects in test_cpp
(fix of commit 6e0590ef1)

Issue Unity-Technologies#37 (bdwgc).

* tests/test_cpp.cc (C::Test): Call GC_gcollect() if incremental mode
and nFreed is too low.

5 years agoAvoid a full GC when growing finalizer tables if in incremental mode
Jonas Echterhoff [Thu, 21 Feb 2019 10:49:16 +0000 (11:49 +0100)]
Avoid a full GC when growing finalizer tables if in incremental mode

Issue Unity-Technologies#37 (bdwgc).

* finalize.c (GC_grow_table): Do not call GC_try_to_collect_inner
if GC_incremental; add comment.

5 years agoUpdate ChangeLog file
Ivan Maidanski [Sun, 17 Feb 2019 18:41:02 +0000 (21:41 +0300)]
Update ChangeLog file

5 years agoUpdate ChangeLog file (v8.0 changes)
Ivan Maidanski [Sun, 17 Feb 2019 17:09:02 +0000 (20:09 +0300)]
Update ChangeLog file (v8.0 changes)
(a cherry-pick of commit 011e159e from 'release-8_0')

5 years agoUpdate ChangeLog file (v7.6 changes)
Ivan Maidanski [Sun, 17 Feb 2019 16:53:15 +0000 (19:53 +0300)]
Update ChangeLog file (v7.6 changes)
(a cherry-pick of commit 1d3beb1c from 'release-7_6')

5 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Sat, 16 Feb 2019 22:49:24 +0000 (01:49 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)
(a cherry-pick of commit dd4558f0 from 'release-7_4')

5 years agoAvoid unexpected heap growth in gctest caused by GC_disable
Ivan Maidanski [Fri, 15 Feb 2019 20:40:49 +0000 (23:40 +0300)]
Avoid unexpected heap growth in gctest caused by GC_disable
(fix of commit 8fc1ebf6d)

Issue #264 (bdwgc).

This commit eliminates the scenario when one thread disables garbage
collections while other threads intensively allocate memory objects.

* tests/test.c (run_one_test): Do not call GC_disable and GC_enable.
* tests/test.c (run_single_threaded_test): New function (which tests
GC_disable and GC_enable).
* tests/test.c (main): Call run_single_threaded_test() (before
check_heap_stats).

5 years agoAppVeyor CI: Fix 'no source or binary dir provided' cmake error
Ivan Maidanski [Fri, 15 Feb 2019 20:22:58 +0000 (23:22 +0300)]
AppVeyor CI: Fix 'no source or binary dir provided' cmake error

The error is fixed by passing "." argument to cmake.

5 years agoWorkaround 'uninitialized variable: info' cppcheck false positive (OS X)
Ivan Maidanski [Thu, 14 Feb 2019 20:17:36 +0000 (23:17 +0300)]
Workaround 'uninitialized variable: info' cppcheck false positive (OS X)

* darwin_stop_world.c [DEBUG_THREADS && CPPCHECK] (GC_thread_resume):
Initialize info.run_state value (to 0) before thread_info() call.

5 years agoFix thread_info() count argument value (OS X)
Ivan Maidanski [Thu, 14 Feb 2019 19:55:20 +0000 (22:55 +0300)]
Fix thread_info() count argument value (OS X)

* darwin_stop_world.c [DEBUG_THREADS || GC_ASSERTIONS]
(GC_thread_resume): Set outCount to THREAD_BASIC_INFO_COUNT (instead
of THREAD_INFO_MAX) to match the size of info passed to thread_info().

5 years agoFix 'wrong __data_start/_end pair' error on Android
Ivan Maidanski [Wed, 13 Feb 2019 22:06:26 +0000 (01:06 +0300)]
Fix 'wrong __data_start/_end pair' error on Android
(fix of commits b746e637b5e73ff184a25965b5f)

Issue #259 (bdwgc).

* include/gc.h [(HOST_ANDROID || __ANDROID__)
&& IGNORE_DYNAMIC_LOADING] (_etext, __data_start, __end__, _end): Do
not declare weak symbols.
* os_dep.c [SEARCH_FOR_DATA_START && (LINUX || HURD) && HOST_ANDROID]
(etext, __dso_handle): Likewise.
* include/gc.h [(HOST_ANDROID || __ANDROID__)
&& IGNORE_DYNAMIC_LOADING] (GC_find_limit): Declare function as public.
* include/gc.h [(HOST_ANDROID || __ANDROID__)
&& IGNORE_DYNAMIC_LOADING] (GC_INIT_CONF_ROOTS): Update comment;
do not use _etext, __data_start, __end__, _end symbols; use
GC_find_limit(__dso_handle,1) as the end of the added GC data root.
* include/private/gc_priv.h [SEARCH_FOR_DATA_START
|| NETBSD && __ELF__] (GC_find_limit): Change ptr_t type to void*,
GC_bool to int.
* include/private/gcconfig.h [(SPARC || ALPHA) && FREEBSD]
(GC_find_limit): Likewise.
* os_dep.c [NEED_FIND_LIMIT || USE_PROC_FOR_LIBRARIES] (GC_find_limit):
Likewise.
* include/private/gcconfig.h [(SPARC || ALPHA) && FREEBSD]
(DATAEND): Cast the result to ptr_t.
* include/private/gcconfig.h [AARCH64 && LINUX && HOST_ANDROID]
(SEARCH_FOR_DATA_START): Remove outdated comment about __data_start.
* os_dep.c [SEARCH_FOR_DATA_START && (LINUX || HURD)
&& !IGNORE_PROG_DATA_START && HOST_ANDROID && !CPPCHECK]
(GC_init_linux_data_start): Do not compare __dso_handle to _etext and
do not use __dso_handle as data start.
* os_dep.c [SEARCH_FOR_DATA_START] (GC_init_linux_data_start): Cast the
result of GC_find_limit() to ptr_t.
* os_dep.c [NETBSD && __ELF__] (GC_init_netbsd_elf): Likewise.
* os_dep.c [LINUX_STACKBOTTOM && IA64] (GC_get_register_stack_base):
Likewise.
* os_dep.c [!AMIGA && !HAIKU && !OS2 && !MSWIN32 && !MSWINCE
&& !CYGWIN32 && !GC_OPENBSD_THREADS && (!GC_SOLARIS_THREADS
|| _STRICT_STDC)] (GC_get_main_stack_base): Likewise.
* os_dep.c [DATASTART_USES_BSDGETDATASTART] (GC_FreeBSDGetDataStart):
Likewise.

5 years agoAdjust printf calls in gctest check_heap_stats so that each has new-line
Ivan Maidanski [Wed, 13 Feb 2019 14:41:51 +0000 (17:41 +0300)]
Adjust printf calls in gctest check_heap_stats so that each has new-line

This is useful if GC_printf uses Android logging.

* tests/test.c (finalizable_count): Do not define if
GC_NO_FINALIZATION.
* tests/test.c (mktree): Do not increment finalizable_count if
GC_NO_FINALIZATION.
* tests/test.c (check_heap_stats): Do not print finalization counts
if GC_NO_FINALIZATION or GC_get_find_leak() is true; call GC_printf
to output finalization counts and the check result just once (i.e.
the whole line is printed in a single GC_printf call).
* tests/test.c [!NO_CLOCK] (check_heap_stats): Call GC_printf just
once to output "Completed <N> collections" together with the total
GC time value and the number of marker threads (i.e. the whole line
is printed in a single GC_printf call).

5 years agoUpdate AUTHORS file
Ivan Maidanski [Tue, 12 Feb 2019 20:28:33 +0000 (23:28 +0300)]
Update AUTHORS file

5 years agoUse atomic primitives for Sony PlayStation Portable 2
Michael Herring [Mon, 28 Jan 2019 03:44:20 +0000 (12:44 +0900)]
Use atomic primitives for Sony PlayStation Portable 2
(a cherry-pick of commit e08e069bc from Unity-Technologies/bdwgc)

Issue #173 (bdwgc).

* include/private/gc_priv.h [THREADS]: Include gc_atomic_ops.h also
if SN_TARGET_PSP2.

5 years agoFix GetThreadContext stale register values use if WoW64 (Win32)
Hamayama [Thu, 7 Feb 2019 21:51:25 +0000 (00:51 +0300)]
Fix GetThreadContext stale register values use if WoW64 (Win32)

Issue #262 (bdwgc).

* misc.c [MSWIN32 && !MSWINRT_FLAVOR && !MSWIN_XBOX1]
(GC_win32_MessageBoxA): Do not define unless SMALL_CONFIG.
* misc.c [MSWIN32 && !_WIN64 && GC_WIN32_THREADS && CHECK_NOT_WOW64]
(GC_init): Do not call IsWow64Process() and GC_win32_MessageBoxA().
* win32_threads.c [I386] (isWow64): New static variable.
* win32_threads.c [I386] (GC_push_stack_for): If isWow64 then set also
CONTEXT_EXCEPTION_REQUEST and CONTEXT_SEGMENTS bits in ContextFlags;
if isWow64, and CONTEXT_EXCEPTION_REPORTING and
CONTEXT_EXCEPTION_ACTIVE are set on return from GetThreadContext then
call GetThreadSelectorEntry and use StackLimit of FS selector to set
sp local variable (instead of context.Esp); add comment.
* win32_threads.c [I386 && DEBUG_THREADS] (GC_push_stack_for): Call
GC_log_printf() to report TIB stack limit/base and the case when
CONTEXT_EXCEPTION_REQUEST is not supported.
* win32_threads.c [I386] (GC_thr_init): Set isWow64 by IsWow64Process()
if the later is available.

5 years agoWorkaround 'checking if unsigned expression < 0' cppcheck warnings
Ivan Maidanski [Thu, 7 Feb 2019 17:43:13 +0000 (20:43 +0300)]
Workaround 'checking if unsigned expression < 0' cppcheck warnings

* alloc.c [CPPCHECK] (GC_compute_heap_usage_percent): Replace
GC_WORD_MAX/100 with (GC_WORD_MAX>>1)/50; add comment.
* os_dep.c [!AMIGA && !HAIKU && !OPENBSD && !OS2 && !MSWIN32]
(GC_get_main_stack_base): Skip assertion on result if CPPCHECK.

5 years agoTravis CI: Test --disable-shared on OS X (x86_64)
Ivan Maidanski [Thu, 7 Feb 2019 06:38:56 +0000 (09:38 +0300)]
Travis CI: Test --disable-shared on OS X (x86_64)

5 years agoEnable mprotect-based incremental GC for Linux/arm and Linux/aarch64
Ivan Maidanski [Fri, 25 Jan 2019 08:42:43 +0000 (11:42 +0300)]
Enable mprotect-based incremental GC for Linux/arm and Linux/aarch64

* include/private/gcconfig.h [AARCH64 && LINUX && !(GC_LINUX_THREADS
&& REDIRECT_MALLOC)] (MPROTECT_VDB): Define macro (similar to X86_64
and I386 cases).
* include/private/gcconfig.h [ARM32 && LINUX && !(GC_LINUX_THREADS
&& REDIRECT_MALLOC)] (MPROTECT_VDB): Likewise.

5 years agoFix 'undefined reference to __data_start' linker error (Android/aarch64)
Ivan Maidanski [Fri, 25 Jan 2019 07:44:25 +0000 (10:44 +0300)]
Fix 'undefined reference to __data_start' linker error (Android/aarch64)

As of NDK r18b, __data_start symbol is only provided by bfd linker.

* include/private/gcconfig.h [AARCH64 && LINUX && HOST_ANDROID]
(__data_start): Do not declare extern variable.
* include/private/gcconfig.h [AARCH64 && LINUX && HOST_ANDROID]
(SEARCH_FOR_DATA_START): Define (instead of DATASTART); add comment.

5 years agoWorkaround 'wrong __data_start/_end' if __end__ is incorrect (Android)
Ivan Maidanski [Thu, 24 Jan 2019 21:54:18 +0000 (00:54 +0300)]
Workaround 'wrong __data_start/_end' if __end__ is incorrect (Android)

Issue #259 (bdwgc).

To prevent use of __end__ symbol, "-D BROKEN_UUENDUU_SYM" should be
passed to CFLAGS.

* include/private/gcconfig.h [HOST_ANDROID && __clang__] (DATAEND):
Do not redefine to __end__ if BROKEN_UUENDUU_SYM.

5 years agoFix 'unexpected mark stack overflow' abort in push_all_stack
Ivan Maidanski [Mon, 21 Jan 2019 22:01:45 +0000 (01:01 +0300)]
Fix 'unexpected mark stack overflow' abort in push_all_stack

Issue #260 (bdwgc).

* mark.c [!NEED_FIXUP_POINTER] (GC_push_all_stack): Call
GC_push_all_eager() instead of GC_push_all() if GC_mark_stack_top is
rather close to GC_mark_stack_limit.

5 years agoWorkaround 'local t shadows outer var' cppcheck warning in disclaim_bench
Ivan Maidanski [Tue, 15 Jan 2019 20:36:55 +0000 (23:36 +0300)]
Workaround 'local t shadows outer var' cppcheck warning in disclaim_bench
(fix of commit 4880d09f6)

Issue #258 (bdwgc).

* include/private/gc_priv.h [!NO_CLOCK && (MSWINRT_FLAVOR
|| WINXP_USE_PERF_COUNTER)] (GET_TIME): Rename t local variable to tc.

5 years agoWorkaround 'if condition is the same as the previous one' cppcheck warnings
Ivan Maidanski [Tue, 15 Jan 2019 16:52:15 +0000 (19:52 +0300)]
Workaround 'if condition is the same as the previous one' cppcheck warnings

* alloc.c [THREAD_LOCAL_ALLOC] (GC_stopped_mark): Set GC_world_stopped
to FALSE after GC_on_collection_event(GC_EVENT_PRE_START_WORLD).
* alloc.c [THREAD_LOCAL_ALLOC] (GC_stopped_mark): Collapse adjacent
"if" statements.
* mark.c [!GC_DISABLE_INCREMENTAL] (GC_initiate_gc): Likewise.
* pthread_stop_world.c [!NACL && !GC_OPENBSD_UTHREADS
&& !GC_NETBSD_THREADS_WORKAROUND] (GC_start_world): Likewise.

5 years agoAppveyor CI: Test MinGW with -D WINXP_USE_PERF_COUNTER
Ivan Maidanski [Mon, 14 Jan 2019 22:01:38 +0000 (01:01 +0300)]
Appveyor CI: Test MinGW with -D WINXP_USE_PERF_COUNTER

5 years agoUse better precision Windows timers
Jonas Echterhoff [Fri, 19 Oct 2018 10:56:45 +0000 (12:56 +0200)]
Use better precision Windows timers
(a cherry-pick of commits 2fe2d434d2d250f72b9cf583af80
from Unity-Technologies/bdwgc)

Issue #258 (bdwgc).

The feature is enabled if MSWINRT_FLAVOR or WINXP_USE_PERF_COUNTER.

* include/private/gc_priv.h [!NO_CLOCK && !BSD_TIME
&& WINXP_USE_PERF_COUNTER]: Include windows.h and winbase.h.
* include/private/gc_priv.h [!NO_CLOCK && !BSD_TIME && (MSWINRT_FLAVOR
|| WINXP_USE_PERF_COUNTER)] (CLOCK_TYPE): Define ULONGLONG (instead of
DWORD).
* include/private/gc_priv.h [!NO_CLOCK && !BSD_TIME && (MSWINRT_FLAVOR
|| WINXP_USE_PERF_COUNTER)] (GET_TIME): Use QueryPerformanceFrequency()
and QueryPerformanceCounter() to get the current time (instead of
GetTickCount64()).
* include/private/gc_priv.h [!NO_CLOCK && !BSD_TIME && (MSWINRT_FLAVOR
|| WINXP_USE_PERF_COUNTER)] (MS_TIME_DIFF): Divide by a million.
* include/private/gc_priv.h [!NO_CLOCK && !BSD_TIME && (MSWINRT_FLAVOR
|| WINXP_USE_PERF_COUNTER)] (NS_FRAC_TIME_DIFF): Return (a-b)%1000000
(instead of 0).

5 years agoReport time with a nanosecond precision where available
Ivan Maidanski [Mon, 14 Jan 2019 06:52:57 +0000 (09:52 +0300)]
Report time with a nanosecond precision where available

Issue #258 (bdwgc).

* alloc.c [!NO_CLOCK] (GC_time_lim_nsec): Update comment.
* alloc.c [!NO_CLOCK && !GC_DISABLE_INCREMENTAL]
(GC_timeout_stop_func): Declare nsec_diff local variable; use
GC_time_lim_nsec.
* alloc.c [!NO_CLOCK && !GC_DISABLE_INCREMENTAL]
(GC_timeout_stop_func): Use NS_FRAC_TIME_DIFF(); print "ns" value after
"ms" one.
* alloc.c [!NO_CLOCK] (GC_try_to_collect_inner, GC_stopped_mark,
GC_finish_collection): Likewise.
* reclaim.c [!NO_CLOCK] (GC_reclaim_all): Likewise.
* include/private/gc_priv.h [!NO_CLOCK && BSD_TIME] (MS_TIME_DIFF):
Always round the result of division toward minus infinity.
* include/private/gc_priv.h [!NO_CLOCK] (NS_FRAC_TIME_DIFF): New macro.

5 years agoReplace "msecs" with "ms" in all comments and messages
Ivan Maidanski [Sun, 6 Jan 2019 11:11:10 +0000 (14:11 +0300)]
Replace "msecs" with "ms" in all comments and messages

* README.md (Bugs): Replace "msecs" with "ms".
* doc/README.environment (GC_PAUSE_TIME_TARGET): Likewise.
* doc/gcdescr.md (Generational Collection and Dirty Bits): Likewise.
* alloc.c [!NO_CLOCK] (full_gc_total_time): Replace "msecs" with "ms"
in comment.
* cord/tests/de.c [WIN32] (beep): Likewise.
* pthread_support.c [USE_SPIN_LOCK] (GC_lock): Likewise.
* alloc.c [!GC_DISABLE_INCREMENTAL && !NO_CLOCK]
(GC_timeout_stop_func): Replace "msecs" with "ms" in the printed
string.
* alloc.c [!NO_CLOCK] (GC_try_to_collect_inner, GC_stopped_mark,
GC_finish_collection): Likewise.
* misc.c [!NO_CLOCK] (GC_dump_named): Likewise.
* reclaim.c [!NO_CLOCK] (GC_reclaim_all): Likewise.
* tests/test.c [!NO_CLOCK] (check_heap_stats): Likewise.

5 years agoTravis CI: Test with -D BSD_TIME passed to CFLAGS
Ivan Maidanski [Sat, 5 Jan 2019 08:56:58 +0000 (11:56 +0300)]
Travis CI: Test with -D BSD_TIME passed to CFLAGS

5 years agoEnsure result of every variant of MS_TIME_DIFF has unsigned long type
Ivan Maidanski [Fri, 4 Jan 2019 16:55:34 +0000 (19:55 +0300)]
Ensure result of every variant of MS_TIME_DIFF has unsigned long type
(code refactoring)

Previously, MS_TIME_DIFF had the result of long type for Nintendo and
Win32 targets.

* include/private/gc_priv.h [!NO_CLOCK && BSD_TIME] (MS_TIME_DIFF): Add
comment.
* include/private/gc_priv.h [!NO_CLOCK && !BSD_TIME && (MSWIN32
|| MSWINCE || NN_PLATFORM_CTR)] (MS_TIME_DIFF): Cast result to
unsigned long (instead of long).

5 years agoFix BSD_TIME variant of MS_TIME_DIFF for the case of a.tv_usec < b.tv_usec
Ivan Maidanski [Fri, 4 Jan 2019 16:37:50 +0000 (19:37 +0300)]
Fix BSD_TIME variant of MS_TIME_DIFF for the case of a.tv_usec < b.tv_usec
(fix of commit 6b2796b69)

* include/private/gc_priv.h [!NO_CLOCK && BSD_TIME] (MS_TIME_DIFF):
Cast the result of a.tv_usec-b.tv_usec to long (so that the result of
the division should be negative if a.tv_usec is less than b.tv_usec).

5 years agoAdd API for accessing incremental GC time limit with nanosecond precision
Ivan Maidanski [Fri, 4 Jan 2019 13:17:31 +0000 (16:17 +0300)]
Add API for accessing incremental GC time limit with nanosecond precision

Issue #258 (bdwgc).

This commit only adds the API (GC_set_time_limit_tv,
GC_get_time_limit_tv).

* alloc.c [!NO_CLOCK] (GC_time_lim_nsec): New STATIC variable.
* alloc.c [!NO_CLOCK] (TV_NSEC_LIMIT): New macro.
* alloc.c [!NO_CLOCK] (GC_set_time_limit_tv, GC_get_time_limit_tv):
New public function definition.
* include/gc.h (GC_time_limit, GC_set_time_limit): Update comment.
* include/gc.h (GC_timeval_s): New struct definition.
* include/gc.h (GC_set_time_limit_tv, GC_get_time_limit_tv): New public
function declaration.
* include/gc.h [GC_TIME_LIMIT && !CPPCHECK] (GC_INIT_CONF_TIME_LIMIT):
Refine comment.
* tests/test.c [!PCR && !GC_WIN32_THREADS && !GC_PTHREADS && CPPCHECK
&& !NO_CLOCK] (main): Add UNTESTED() for GC_get_time_limit_tv and
GC_set_time_limit_tv.

5 years agoFix invalid initializer of CLOCK_TYPE variables if BSD_TIME
Ivan Maidanski [Sat, 5 Jan 2019 08:52:53 +0000 (11:52 +0300)]
Fix invalid initializer of CLOCK_TYPE variables if BSD_TIME
(fix of commits 7e59301c106ecaefca)

* alloc.c [!NO_CLOCK] (GC_start_time): Initialize to
CLOCK_TYPE_INITIALIZER (instead of 0).
* alloc.c [!NO_CLOCK] (GC_try_to_collect_inner, GC_stopped_mark,
GC_finish_collection): Initialize local variable of CLOCK_TYPE type to
CLOCK_TYPE_INITIALIZER (instead of 0); remove comment (duplicating that
in gc_priv.h).
* reclaim.c [!NO_CLOCK] (GC_reclaim_all): Likewise.
* include/private/gc_priv.h [!NO_CLOCK] (CLOCK_TYPE_INITIALIZER):
Define macro.

5 years agoWorkaround 'me assigned value never used' cppcheck FP in register_my_thread
Ivan Maidanski [Sat, 29 Dec 2018 07:12:44 +0000 (10:12 +0300)]
Workaround 'me assigned value never used' cppcheck FP in register_my_thread

* pthread_support.c [CPPCHECK] (GC_register_my_thread): Call
GC_noop1(me->flags) after reassigning me to the result of
GC_register_my_thread_inner(sb,self).
* win32_threads.c [CPPCHECK] (GC_register_my_thread): Likewise.

5 years agoTravis CI: Do not pass --quiet to cppcheck
Ivan Maidanski [Sat, 29 Dec 2018 07:02:12 +0000 (10:02 +0300)]
Travis CI: Do not pass --quiet to cppcheck
(fix of commit e3d3b3bec)

In case of cppcheck quiet mode, grep (in the pipe) exits with an error.

5 years agoTravis CI: Workaround timeout of 'cppcheck --enable=unusedFunction --force'
Ivan Maidanski [Fri, 28 Dec 2018 21:50:34 +0000 (00:50 +0300)]
Travis CI: Workaround timeout of 'cppcheck --enable=unusedFunction --force'

"cppcheck --enable=unusedFunction --force extra/gc.c" takes longer than
the Travis CI timeout (50m), so gc.c is checked for unused functions
without --force option for now.

5 years agoSupport de_win.c compilation by Makefile.direct (cord/de)
Ivan Maidanski [Thu, 27 Dec 2018 09:03:29 +0000 (12:03 +0300)]
Support de_win.c compilation by Makefile.direct (cord/de)

* Makefile.direct (cord/de): Add dependency on de_win.c and de_win.h;
compile cord/tests/de_win.c (in case of if_not_there case).
* cord/tests/de_win.c [!__BORLANDC__ && !__CYGWIN__ && !__MINGW32__
&& !__NT__ && !_WIN32 && !WIN32]: Skip the whole file (compile
"extern int GC_quiet" instead).

5 years agoAvoid test.o rebuild on tests folder timestamp change (Makefile.direct)
Ivan Maidanski [Thu, 27 Dec 2018 08:36:15 +0000 (11:36 +0300)]
Avoid test.o rebuild on tests folder timestamp change (Makefile.direct)

* Makefile.direct (tests/test.o): Remove dependency on "tests" target;
execute "mkdir tests".
* Makefile.direct (tests): Remove target.

5 years agoRemove Linux-specific commands for building cord/de from Makefile.direct
Ivan Maidanski [Thu, 27 Dec 2018 08:28:04 +0000 (11:28 +0300)]
Remove Linux-specific commands for building cord/de from Makefile.direct
(code refactoring)

The cord/de build options are not specific for Linux targets.

* Makefile.direct (cord/de): Remove "if_mach * LINUX" commands.

6 years agoUpdate ChangeLog file
Ivan Maidanski [Wed, 26 Dec 2018 08:01:21 +0000 (11:01 +0300)]
Update ChangeLog file

6 years agoUse atomics on PS4
Jonas Echterhoff [Tue, 18 Dec 2018 10:14:55 +0000 (11:14 +0100)]
Use atomics on PS4
(a cherry-pick of commit 46615fe1d from Unity-Technologies/bdwgc)

* include/private/gc_priv.h [THREADS && SN_TARGET_ORBIS]: Include
gc_atomic_ops.h too.

6 years agoUpdate ChangeLog file (set v8.0.2 release date)
Ivan Maidanski [Sun, 23 Dec 2018 20:22:11 +0000 (23:22 +0300)]
Update ChangeLog file (set v8.0.2 release date)

6 years agoUpdate ChangeLog file (v8.0 changes)
Ivan Maidanski [Sun, 23 Dec 2018 08:56:50 +0000 (11:56 +0300)]
Update ChangeLog file (v8.0 changes)

6 years agoUpdate libgc.so version info to differentiate against v8.0.x
Ivan Maidanski [Sun, 23 Dec 2018 17:20:56 +0000 (20:20 +0300)]
Update libgc.so version info to differentiate against v8.0.x

There are no API/implementation changes in libcord and libgccpp against
release-8_0 for now, so the corresponding version info is not updated.

There are some implementation changes and new API functions addition in
libgc (without API incompatible changes) against release-8_0, so the
"current" and "age" parts of the version info are incremented.

* Makefile.am (LIBGC_VER_INFO): Change version info to 6:0:5.

6 years agoTurn on memory unmapping in BCC/DMC/NT/WCC makefiles and Makefile.direct
Ivan Maidanski [Sun, 23 Dec 2018 07:50:15 +0000 (10:50 +0300)]
Turn on memory unmapping in BCC/DMC/NT/WCC makefiles and Makefile.direct

* BCC_MAKEFILE (defines): Add -D USE_MUNMAP.
* NT_MAKEFILE (CFLAGS_DEFAULT): Likewise.
* WCC_MAKEFILE [MSWIN32] (DEFS): Likewise.
* digimars.mak (DEFINES): Likewise.
* Makefile.direct (CFLAGS): Add -D USE_MMAP -D USE_MUNMAP.

6 years agoDocument HANDLE_FORK macro optional usage in Makefile.direct
Ivan Maidanski [Sat, 22 Dec 2018 18:55:17 +0000 (21:55 +0300)]
Document HANDLE_FORK macro optional usage in Makefile.direct

* Makefile.direct (CFLAGS): Add comment about -D HANDLE_FORK.

6 years agoDo not prevent GC from looking at environment variables (BCC_MAKEFILE)
Ivan Maidanski [Sat, 22 Dec 2018 18:49:22 +0000 (21:49 +0300)]
Do not prevent GC from looking at environment variables (BCC_MAKEFILE)

* BCC_MAKEFILE (defines): Remove -D NO_GETENV.

6 years agoTurn on gcj functionality in BCC, DMC, NT, OS/2, WCC makefiles
Ivan Maidanski [Sat, 22 Dec 2018 18:27:19 +0000 (21:27 +0300)]
Turn on gcj functionality in BCC, DMC, NT, OS/2, WCC makefiles

* BCC_MAKEFILE (defines): Add -D GC_GCJ_SUPPORT.
* Makefile.direct (CFLAGS): Likewise.
* OS2_MAKEFILE (CFLAGS): Likewise.
* WCC_MAKEFILE (DEFS): Likewise.
* digimars.mak (DEFINES): Likewise.
* BCC_MAKEFILE (XXXOBJS): Add XXXgcj_mlc.obj.
* NT_MAKEFILE (CFLAGS_DEFAULT): New variable (value copied from .c.obj);
add -D GC_GCJ_SUPPORT.
* NT_MAKEFILE (OBJS): Add gcj_mlc.obj.
* OS2_MAKEFILE (OBJS): Likewise.
* WCC_MAKEFILE (OBJS): Likewise.
* digimars.mak (OBJS): Likewise.
* NT_MAKEFILE (.c.obj, .cpp.obj): Use CFLAGS_DEFAULT variable.

6 years agoAbort with appropriate message if executable pages cannot be allocated
Ivan Maidanski [Thu, 20 Dec 2018 23:33:49 +0000 (02:33 +0300)]
Abort with appropriate message if executable pages cannot be allocated

This may happen e.g. if PaX MPROTECT feature is enabled.

* os_dep.c [!OS2 && !PCR && !AMIGA && !USE_WINALLOC && !MACOS
&& !DOS4GW && !NONSTOP && !SN_TARGET_PSP2 && !RTEMS && !__CC_ARM
&& MMAP_SUPPORTED] (GC_unix_mmap_get_mem): Treat result==MAP_FAILED as
unlikely; if the first mmap call returns MAP_FAILED then ABORT with the
appropriate message if GC_pages_executable (and errno is EACCES).

6 years agoFix 'mprotect remapping failed' abort on NetBSD with PaX enabled
Ivan Maidanski [Thu, 20 Dec 2018 21:54:55 +0000 (00:54 +0300)]
Fix 'mprotect remapping failed' abort on NetBSD with PaX enabled

Issue #255 (bdwgc).

Without this patch, GC_remap() works on NetBSD which has the PaX feature
only if PaX MPROTECT is off (sysctl -w security.pax.mprotect.enabled=0).

* os_dep.c [USE_MUNMAP && !USE_WINALLOC && NETBSD] (GC_remap): Call
mmap() instead of mprotect().

6 years agoTravis CI: Test with -D TEST_PAGES_EXECUTABLE passed to CFLAGS
Ivan Maidanski [Thu, 20 Dec 2018 21:30:57 +0000 (00:30 +0300)]
Travis CI: Test with -D TEST_PAGES_EXECUTABLE passed to CFLAGS

6 years agoAllow to force executable pages allocation in gctest
Ivan Maidanski [Thu, 20 Dec 2018 08:34:12 +0000 (11:34 +0300)]
Allow to force executable pages allocation in gctest

Pass -D TEST_PAGES_EXECUTABLE to CFLAGS to enable the executable pages
allocation in gctest even if the collector is compiled with
NO_EXECUTE_PERMISSION.

* tests/test.c (INIT_PAGES_EXECUTABLE): New macro (calls
GC_set_pages_executable(1) if TEST_PAGES_EXECUTABLE).
* tests/test.c (GC_COND_INIT): Call INIT_PAGES_EXECUTABLE (before
GC_OPT_INIT).
* tests/test.c [!PCR && !GC_WIN32_THREADS && !GC_PTHREADS && CPPCHECK]
(main): Remove UNTESTED(GC_set_pages_executable).

6 years agoFix executable memory allocation in GC_unix_get_mem
Ivan Maidanski [Thu, 20 Dec 2018 08:12:06 +0000 (11:12 +0300)]
Fix executable memory allocation in GC_unix_get_mem

Previously, sbrk() was used for the memory allocation even if the
executable pages were requested.

* os_dep.c [!OS2 && !PCR && !AMIGA && !USE_WINALLOC && !MACOS
&& !DOS4GW && !NONSTOP && !SN_TARGET_PSP2 && !RTEMS && !__CC_ARM
&& MMAP_SUPPORTED] (GC_unix_get_mem): Do not call GC_unix_sbrk_get_mem
if GC_pages_executable; add comment.

6 years agoWorkaround 'nl-result_buf is out of bounds' cppcheck false positive
Ivan Maidanski [Wed, 19 Dec 2018 23:14:16 +0000 (02:14 +0300)]
Workaround 'nl-result_buf is out of bounds' cppcheck false positive

* os_dep.c [NEED_CALLINFO && LINUX && !SMALL_CONFIG] (GC_print_callers):
Replace nl-result_buf to (word)nl-COVERT_DATAFLOW(result_buf).

6 years agoWorkaround 'argument dummy to GC_noop1 is always 1' cppcheck false positive
Ivan Maidanski [Wed, 19 Dec 2018 23:10:04 +0000 (02:10 +0300)]
Workaround 'argument dummy to GC_noop1 is always 1' cppcheck false positive

* misc.c [!ALWAYS_SMALL_CLEAR_STACK && !STACK_NOT_SCANNED
&& !ASM_CLEAR_CODE && CPPCHECK] (GC_clear_stack_inner): Pass dummy[0]
instead of address of dummy variable.

6 years agoEliminate 'stop variable is always 0' compiler warning in print_callers
Ivan Maidanski [Wed, 19 Dec 2018 19:50:57 +0000 (22:50 +0300)]
Eliminate 'stop variable is always 0' compiler warning in print_callers

* os_dep.c [NEED_CALLINFO] (GC_print_callers): Declare (and use value
of) stop local variable only if LINUX && !SMALL_CONFIG; move stop local
variable to the scope of its use.

6 years agoWorkaround '__data_start<_etext is always false' cppcheck false positive
Ivan Maidanski [Wed, 19 Dec 2018 19:17:25 +0000 (22:17 +0300)]
Workaround '__data_start<_etext is always false' cppcheck false positive

* os_dep.c [SEARCH_FOR_DATA_START && (LINUX || HURD)
&& !IGNORE_PROG_DATA_START && HOST_ANDROID] (GC_init_linux_data_start):
Skip the workaround for "gold" linker if CPPCHECK.

6 years agoEliminate 'hash_val value is never used' cppcheck false positive
Ivan Maidanski [Wed, 19 Dec 2018 19:11:42 +0000 (22:11 +0300)]
Eliminate 'hash_val value is never used' cppcheck false positive

* specific.c [USE_CUSTOM_SPECIFIC] (GC_setspecific): Change type of
hash_val local variable from int to unsigned.
* specific.c [USE_CUSTOM_SPECIFIC] (GC_slow_getspecific): Remove
hash_val local variable.

6 years agoUpdate NO_EXECUTE_PERMISSION documentation
Ivan Maidanski [Tue, 18 Dec 2018 23:28:21 +0000 (02:28 +0300)]
Update NO_EXECUTE_PERMISSION documentation

* doc/README.macros (NO_EXECUTE_PERMISSION): Update and refine the
documentation (e.g. mention memory unmapping).

6 years agoDefine GC_ATOMIC_UNCOLLECTABLE and JAVA_FINALIZATION in all make scripts
Ivan Maidanski [Tue, 18 Dec 2018 23:17:58 +0000 (02:17 +0300)]
Define GC_ATOMIC_UNCOLLECTABLE and JAVA_FINALIZATION in all make scripts

This matches the policy of configure and CMakeLists.txt.

* BCC_MAKEFILE (defines): Add -D GC_ATOMIC_UNCOLLECTABLE.
* NT_MAKEFILE (.cpp.obj): Likewise.
* Makefile.direct (CFLAGS): Add -D JAVA_FINALIZATION; reorder options.
* NT_MAKEFILE (.c.obj): Add -D GC_ATOMIC_UNCOLLECTABLE
-D JAVA_FINALIZATION.
* OS2_MAKEFILE (CFLAGS): Likewise.
* WCC_MAKEFILE (DEFS): Likewise.
* build/s60v3/libgc.mmp: Likewise.
* digimars.mak (DEFINES): Likewise.
* gc.mak [$CFG=="gc - Win32 Release" || $CFG=="gc - Win32 Debug"]
(CPP_PROJ): Likewise.
* NT_MAKEFILE (.cpp.obj): Remove redundant -I $(AO_INCLUDE_DIR)
-D ALL_INTERIOR_POINTERS.

6 years agoRemove redundant options for building 'cord' in gc.mak
Ivan Maidanski [Tue, 18 Dec 2018 22:19:53 +0000 (01:19 +0300)]
Remove redundant options for building 'cord' in gc.mak
(code refactoring)

* gc.mak [$CFG=="cord - Win32 Release" || $CFG=="cord - Win32 Debug"]
(CPP_PROJ): Remove -D ALL_INTERIOR_POINTERS -D ENABLE_DISCLAIM
-I libatomic_ops/src.

6 years agoDefault to non-executable memory allocation across all make scripts
Ivan Maidanski [Tue, 18 Dec 2018 21:48:13 +0000 (00:48 +0300)]
Default to non-executable memory allocation across all make scripts

This matches the policy of Makefile.direct, configure and CMakeLists.txt.

* BCC_MAKEFILE (defines): Add -D NO_EXECUTE_PERMISSION.
* NT_MAKEFILE (.c.obj): Likewise.
* OS2_MAKEFILE (CFLAGS): Likewise.
* WCC_MAKEFILE (DEFS): Likewise.
* digimars.mak (DEFINES): Likewise.
* gc.mak [$CFG=="gc - Win32 Release" || $CFG=="gc - Win32 Debug"]
(CPP_PROJ): Likewise.

6 years agoUpdate ChangeLog file (set v7.6.10 release date)
Ivan Maidanski [Thu, 13 Dec 2018 06:47:35 +0000 (09:47 +0300)]
Update ChangeLog file (set v7.6.10 release date)

6 years agoUpdate ChangeLog file (set v7.4.16 release date)
Ivan Maidanski [Thu, 13 Dec 2018 05:57:24 +0000 (08:57 +0300)]
Update ChangeLog file (set v7.4.16 release date)

6 years agoUpdate ChangeLog file (set v7.2m release date)
Ivan Maidanski [Tue, 11 Dec 2018 19:46:20 +0000 (22:46 +0300)]
Update ChangeLog file (set v7.2m release date)