]> granicus.if.org Git - gc/log
gc
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.)

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

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

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

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

7 years agoEliminate 'possible loss of data' MS VC warning in disclaim_and_reclaim
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).

7 years agoEliminate 'possible loss of data' compiler warnings in cord (MS VC)
Ivan Maidanski [Thu, 20 Apr 2017 08:50:03 +0000 (11:50 +0300)]
Eliminate 'possible loss of data' compiler warnings in cord (MS VC)
(Cherry-pick commit 1060ec9 from 'release-7_6' branch.)

* 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.

7 years agoEliminate 'incompatible function pointer' warning in mark_some (MinGW/x86)
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).

7 years agoEliminate 'locally defined symbol imported' MS linker warnings (cord)
Ivan Maidanski [Thu, 20 Apr 2017 21:54:16 +0000 (00:54 +0300)]
Eliminate 'locally defined symbol imported' MS linker warnings (cord)

* NT_X64_THREADS_MAKEFILE (.c.obj): Add -DCORD_NOT_DLL option.
* include/cord.h [GC_DLL] (CORD_API): Define to "extern" if CORD_NOT_DLL.

7 years agoSuppress MS VC warnings about unused param, const condition (NT_MAKEFILE)
Ivan Maidanski [Thu, 20 Apr 2017 21:15:14 +0000 (00:15 +0300)]
Suppress MS VC warnings about unused param, const condition (NT_MAKEFILE)

* NT_X64_STATIC_THREADS_MAKEFILE (.c.obj): Add /wd4100 /wd4127 options
(to suppress "unreferenced formal parameter" and
"conditional expression is constant" compiler warnings).
* NT_X64_THREADS_MAKEFILE (.c.obj): Likewise.

7 years agoRemove all generated files by NT_X64_THREADS_MAKEFILE 'clean' target
Ivan Maidanski [Thu, 20 Apr 2017 09:05:29 +0000 (12:05 +0300)]
Remove all generated files by NT_X64_THREADS_MAKEFILE 'clean' target

* NT_X64_THREADS_MAKEFILE (clean): Delete also .exe, .log, .pdb, .exp,
.lib, .obj, .rbj, .res, *.dll, test_cpp.cpp files in cord, cord\tests,
extra, tests folders; redirect stderr for "del" utility to nul.

7 years agoRemove non-existent configure option in simple_example.html
Ivan Maidanski [Fri, 5 May 2017 08:07:34 +0000 (11:07 +0300)]
Remove non-existent configure option in simple_example.html

* doc/simple_example.html (Threads): Remove --enable-thread-local-alloc
option (for configure).

7 years agoRefine Makefile.direct comment about multi-threaded GC build
Ivan Maidanski [Mon, 17 Apr 2017 07:32:32 +0000 (10:32 +0300)]
Refine Makefile.direct comment about multi-threaded GC build

* Makefile.direct (CFLAGS): Refine comment how to build multi-threaded
collector in a general case.

7 years agoFix various typos in doc/README and .html files
Ivan Maidanski [Thu, 18 May 2017 22:52:59 +0000 (01:52 +0300)]
Fix various typos in doc/README and .html files
(Cherry-pick commit 6afeb18 from 'master' branch.)

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

7 years agoFix unpaired quote symbol in README.Mac
Ivan Maidanski [Fri, 12 May 2017 14:21:19 +0000 (17:21 +0300)]
Fix unpaired quote symbol in README.Mac

* doc/README.Mac: Fix a typo (remove unpaired double-quote).

7 years agoFix typo in README.hp
Ivan Maidanski [Fri, 12 May 2017 07:05:59 +0000 (10:05 +0300)]
Fix typo in README.hp

* doc/README.hp: Fix typo ("recently") in documentation.

7 years agoFix typos in README.DGUX386
Ivan Maidanski [Fri, 5 May 2017 16:46:43 +0000 (19:46 +0300)]
Fix typos in README.DGUX386

* doc/README.DGUX386: Fix typos ("version", "x86", "parallel") in
documentation.

7 years agoFix 'doc' files installation folder
Andy Li [Tue, 9 May 2017 01:54:19 +0000 (09:54 +0800)]
Fix 'doc' files installation folder

Docs are dist_doc_DATA.  They should be installed to /usr/share/doc.

* doc/doc.am (dist_pkgdata_DATA): Move all items to dist_doc_DATA.

7 years agoFix OSF1 host pattern in CMakeLists.txt
Ivan Maidanski [Thu, 4 May 2017 21:49:53 +0000 (00:49 +0300)]
Fix OSF1 host pattern in CMakeLists.txt

* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && osf]: Replace ".*-.*-osf*"
pattern ".*-.*-osf.*" (a missing "." before "*" is added).

7 years agoFix missing win32_threads.c compilation for Cygwin (CMake)
Ivan Maidanski [Wed, 3 May 2017 08:09:50 +0000 (11:09 +0300)]
Fix missing win32_threads.c compilation for Cygwin (CMake)

* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && *-*-cygwin*] (SRC): Add
win32_threads.c.
* CMakeLists.txt (win32_threads): Remove commented out variable
definition.

7 years agoFix AO_SRC_DIR target name in NT_*_MAKEFILE
Ivan Maidanski [Tue, 18 Apr 2017 08:42:06 +0000 (11:42 +0300)]
Fix AO_SRC_DIR target name in NT_*_MAKEFILE

* NT_STATIC_THREADS_MAKEFILE (AO_SCR_DIR): Rename target to
$(AO_SRC_DIR).
* NT_X64_STATIC_THREADS_MAKEFILE (AO_SCR_DIR): Likewise.
* NT_X64_THREADS_MAKEFILE (AO_SCR_DIR): Likewise.

7 years agoFix a typo in comment in NT_MAKEFILE
Ivan Maidanski [Tue, 18 Apr 2017 08:37:26 +0000 (11:37 +0300)]
Fix a typo in comment in NT_MAKEFILE

* NT_MAKEFILE (gctest.exe): Fix typo ("application") in comment.
* NT_STATIC_THREADS_MAKEFILE (gctest.exe): Likewise.
* NT_X64_STATIC_THREADS_MAKEFILE (gctest.exe): Likewise.
* NT_X64_THREADS_MAKEFILE (gctest.exe): Likewise.

7 years agoUpdate AUTHORS file (add Ryan Gonzalez)
Ivan Maidanski [Thu, 13 Apr 2017 15:33:20 +0000 (18:33 +0300)]
Update AUTHORS file (add Ryan Gonzalez)

7 years agoFix crash in FirstDLOpenedLinkMap if app linked statically (Alpine Linux)
Ryan Gonzalez [Thu, 13 Apr 2017 15:31:00 +0000 (18:31 +0300)]
Fix crash in FirstDLOpenedLinkMap if app linked statically (Alpine Linux)

Issue #154 (bdwgc).

* dyn_load.c [SOLARISDL && !USE_PROC_FOR_LIBRARIES]
(GC_FirstDLOpenedLinkMap): Do not dereference d_un.d_ptr if it is null.
* dyn_load.c [(SCO_ELF || DGUX || HURD || LINUX || FREEBSD || NACL
|| NETBSD || OPENBSD) && !USE_PROC_FOR_LIBRARIES]
(GC_FirstDLOpenedLinkMap): Likewise.

7 years agoEliminate 'signed/unsigned mismatch' compiler warning in gctest (MS VC)
Ivan Maidanski [Thu, 20 Apr 2017 08:26:11 +0000 (11:26 +0300)]
Eliminate 'signed/unsigned mismatch' compiler warning in gctest (MS VC)
(fix commit 014d92d)

* tests/test.c (bm_huge): Add explicit casts of GC_signed_word values
to GC_word.

7 years ago.gitignore: Ignore cord/tests/de_win.rbj
Ivan Maidanski [Sat, 22 Apr 2017 06:58:56 +0000 (09:58 +0300)]
.gitignore: Ignore cord/tests/de_win.rbj

7 years ago.gitignore: Ignore auto-generated test_cpp.cpp
Ivan Maidanski [Wed, 19 Apr 2017 21:17:55 +0000 (00:17 +0300)]
.gitignore: Ignore auto-generated test_cpp.cpp

7 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Wed, 12 Apr 2017 07:15:05 +0000 (10:15 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

7 years agoTravis CI: Test also Intel x32 builds (Linux)
Ivan Maidanski [Wed, 29 Mar 2017 20:33:42 +0000 (23:33 +0300)]
Travis CI: Test also Intel x32 builds (Linux)

7 years agoTravis CI: Test also 32-bit, 64-bit builds with clang-4.0, gcc-5 (Linux)
Ivan Maidanski [Wed, 29 Mar 2017 20:29:47 +0000 (23:29 +0300)]
Travis CI: Test also 32-bit, 64-bit builds with clang-4.0, gcc-5 (Linux)
(Cherry-pick commit 80085ae from 'master' branch.)

7 years agoTravis CI: Test --disable-static without assertions
Ivan Maidanski [Mon, 10 Apr 2017 21:27:36 +0000 (00:27 +0300)]
Travis CI: Test --disable-static without assertions

7 years agoTravis CI: Test also --enable-redirect-malloc
Ivan Maidanski [Thu, 16 Mar 2017 21:42:52 +0000 (00:42 +0300)]
Travis CI: Test also --enable-redirect-malloc
(Cherry-pick commits c62abbba83901c from 'master' branch.)

7 years agoTravis CI: Test builds with -D LINT2
Ivan Maidanski [Mon, 27 Mar 2017 21:38:01 +0000 (00:38 +0300)]
Travis CI: Test builds with -D LINT2
(Cherry-pick commit 518eb14 from 'master' branch.)

7 years agoTravis CI: Test --enable-large-config without --enable-munmap
Ivan Maidanski [Mon, 10 Apr 2017 19:37:31 +0000 (22:37 +0300)]
Travis CI: Test --enable-large-config without --enable-munmap

7 years agoTravis CI: Also test --enable-large-config in 32-bit mode (Linux)
Ivan Maidanski [Tue, 7 Mar 2017 16:53:30 +0000 (19:53 +0300)]
Travis CI: Also test --enable-large-config in 32-bit mode (Linux)
(Cherry-pick commit 4e08ea9 from 'master' branch.)

7 years agoTravis CI: Test also with -std=c11 (in single-threaded mode only)
Ivan Maidanski [Tue, 28 Mar 2017 20:22:17 +0000 (23:22 +0300)]
Travis CI: Test also with -std=c11 (in single-threaded mode only)
(Cherry-pick commits 47483e72a1b2bb from 'master' branch.)

7 years agoTravis CI: Test also -D POINTER_MASK
Ivan Maidanski [Thu, 16 Mar 2017 08:33:49 +0000 (11:33 +0300)]
Travis CI: Test also -D POINTER_MASK
(Cherry-pick commit 8de183d from 'master' branch.)

7 years agoTravis CI: Test also ENABLE_TRACE macro
Ivan Maidanski [Thu, 16 Mar 2017 08:31:48 +0000 (11:31 +0300)]
Travis CI: Test also ENABLE_TRACE macro
(Cherry-pick commit 7913227 from 'master' branch.)

7 years agoTravis CI: Test also various -D DEBUG_x
Ivan Maidanski [Thu, 16 Mar 2017 08:18:58 +0000 (11:18 +0300)]
Travis CI: Test also various -D DEBUG_x
(Cherry-pick commits 19db2c60eaf773 from 'master' branch.)

7 years agoTravis CI: Test also -D DBG_HDRS_ALL -D SHORT_DBG_HDRS
Ivan Maidanski [Fri, 17 Mar 2017 07:25:58 +0000 (10:25 +0300)]
Travis CI: Test also -D DBG_HDRS_ALL -D SHORT_DBG_HDRS
(Cherry-pick commit d9409e8 from 'master' branch.)

7 years agoTravis CI: Also test with musl-gcc (Linux)
Ivan Maidanski [Mon, 27 Mar 2017 22:07:10 +0000 (01:07 +0300)]
Travis CI: Also test with musl-gcc (Linux)
(Cherry-pick commits 07d989511263e5 from 'master' branch.)

7 years agoTravis CI: Test also -D CHECKSUMS, -D SMALL_CONFIG, -D MARK_BIT_PER_OBJ
Ivan Maidanski [Fri, 10 Mar 2017 21:54:45 +0000 (00:54 +0300)]
Travis CI: Test also -D CHECKSUMS, -D SMALL_CONFIG, -D MARK_BIT_PER_OBJ
(Cherry-pick commits 817ea6f6d5f40e from 'master' branch.)

7 years agoTravis CI: Output gctest.log content
Ivan Maidanski [Tue, 7 Mar 2017 15:24:23 +0000 (18:24 +0300)]
Travis CI: Output gctest.log content
(Cherry-pick commit 6738fe3 from 'master' branch.)

7 years agoTravis CI: Output config.h content
Ivan Maidanski [Mon, 27 Feb 2017 21:38:51 +0000 (00:38 +0300)]
Travis CI: Output config.h content
(Cherry-pick commit 631a74a from 'master' branch.)

7 years agoTravis CI: Replace multiple CONF_x with a single CONF_OPTIONS variable
Ivan Maidanski [Sun, 9 Apr 2017 14:42:40 +0000 (17:42 +0300)]
Travis CI: Replace multiple CONF_x with a single CONF_OPTIONS variable
(Cherry-pick commit 0138d60 from 'master' branch.)

7 years agoTravis CI: Specify test configurations using 'matrix:include'
Ivan Maidanski [Fri, 24 Mar 2017 15:34:09 +0000 (18:34 +0300)]
Travis CI: Specify test configurations using 'matrix:include'
(Cherry-pick commit 369d606 from 'master' branch.)

Also, require "sudo" only where needed.

7 years agoChangeLog: remove trailing dots
Ivan Maidanski [Wed, 5 Apr 2017 08:01:48 +0000 (11:01 +0300)]
ChangeLog: remove trailing dots
(Cherry-pick commit cf5aa64 from 'release-7_6' branch.)

7 years agoUpdate shared libraries version info to differentiate against v7.2
Ivan Maidanski [Fri, 7 Apr 2017 16:14:24 +0000 (19:14 +0300)]
Update shared libraries version info to differentiate against v7.2

There some API changes in libgc against v7.2, so the "current" number
of the version info is incremented, thus the version info is now 3:0:1.

There are no API changes in libcord and libgccpp against v7.2
but some implementation changes exist, 2:*:* version info is reserved
for v7.2, so the version info for libcord and libgccpp is now 3:0:2.

* Makefile.am (LIBGC_VER_INFO): Change version info to 3:0:1.
* Makefile.am (LIBGCCPP_VER_INFO): Change version info to 3:0:2.
* cord/cord.am (LIBCORD_VER_INFO): Likewise.

7 years agoFix GC shared library tests failure (musl)
Ivan Maidanski [Fri, 17 Mar 2017 08:21:13 +0000 (11:21 +0300)]
Fix GC shared library tests failure (musl)

Detect dl_iterate_phdr() presence by configure.

* configure.ac (dl_iterate_phdr): Add AC_CHECK_FUNCS for.
* configure.ac [ac_cv_func_dl_iterate_phdr] (HAVE_DL_ITERATE_PHDR):
AC_DEFINE it.

7 years agoUse AC_DEFINE for defining NO_GETCONTEXT in configure
Ivan Maidanski [Wed, 15 Mar 2017 21:49:22 +0000 (00:49 +0300)]
Use AC_DEFINE for defining NO_GETCONTEXT in configure
(code refactoring of commit 7c13fb8)

* configure.ac [!ac_cv_func_getcontext]: Use AC_DEFINE(NO_GETCONTEXT)
instead of directly adding -D NO_GETCONTEXT to CFLAGS.

7 years agoUpdate AUTHORS file
Ivan Maidanski [Wed, 15 Mar 2017 21:41:11 +0000 (00:41 +0300)]
Update AUTHORS file

7 years agoconfigure.ac: add check for NO_GETCONTEXT definition
Samuel Martin [Wed, 15 Mar 2017 21:39:37 +0000 (00:39 +0300)]
configure.ac: add check for NO_GETCONTEXT definition

* configure.ac: Add AC_CHECK_FUNCS(getcontext); add -DNO_GETCONTEXT to
CFLAGS if $ac_cv_func_getcontext is "no".

7 years agoAllow HAVE_DL_ITERATE_PHDR to be defined by client (musl)
Ivan Maidanski [Fri, 17 Mar 2017 08:05:56 +0000 (11:05 +0300)]
Allow HAVE_DL_ITERATE_PHDR to be defined by client (musl)

Do not redefine HAVE_DL_ITERATE_PHDR macro if already defined.

* dyn_load.c [OPENBSD>=200519] (HAVE_DL_ITERATE_PHDR): Do not define
if already defined.
* dyn_load.c [!USE_PROC_FOR_LIBRARIES && (__GLIBC__>=2
|| PLATFORM_ANDROID)] (HAVE_DL_ITERATE_PHDR): Likewise.
* dyn_load.c [!USE_PROC_FOR_LIBRARIES && HAVE_DL_ITERATE_PHDR
&& !DL_ITERATE_PHDR_STRONG] (dl_iterate_phdr): Define as weak symbol
(even if HAVE_DL_ITERATE_PHDR is defined outside this file).

7 years agoSupport CFLAGS_EXTRA when checking for inline and dladdr (configure)
Ivan Maidanski [Thu, 23 Mar 2017 08:38:38 +0000 (11:38 +0300)]
Support CFLAGS_EXTRA when checking for inline and dladdr (configure)
(fix commits 0e175f35dedb24)

* configure.ac (AC_C_INLINE, AC_TRY_COMPILE(dladdr)): Add $CFLAGS_EXTRA
to CFLAGS temporarily (restore CFLAGS after the check).

7 years agoEliminate 'ISO C forbids object to function pointer conversion' warning
Ivan Maidanski [Thu, 16 Mar 2017 07:22:29 +0000 (10:22 +0300)]
Eliminate 'ISO C forbids object to function pointer conversion' warning
(Cherry-pick commit c69ae9c from 'release-7_6' branch.)

* dyn_load.c [SOLARISDL && !USE_PROC_FOR_LIBRARIES
&& SUNOS53_SHARED_LIB] (GC_FirstDLOpenedLinkMap): Cast result of dlsym()
to word type before casting it to a function pointer.
* pthread_support.c [GC_USE_DLOPEN_WRAP] (GC_init_real_syms): Likewise.

7 years agoEliminate 'type defaults to int in declaration' warning (REDIRECT_MALLOC)
Ivan Maidanski [Wed, 15 Mar 2017 22:02:12 +0000 (01:02 +0300)]
Eliminate 'type defaults to int in declaration' warning (REDIRECT_MALLOC)

* os_dep.c [REDIRECT_MALLOC] (GC_in_save_callers): Add missing type
(GC_bool) of the declared variable.

7 years agoFix missing .exe for disclaim test filenames in Makefile (MinGW)
Ivan Maidanski [Wed, 1 Mar 2017 23:03:11 +0000 (02:03 +0300)]
Fix missing .exe for disclaim test filenames in Makefile (MinGW)
(fix commit 6c1a924)

Also add 4 blank lines to improve tests.am readability.

* tests/tests.am [ENABLE_DISCLAIM] (TESTS): Add $(EXEEXT) suffix to
disclaim_test, disclaim_bench.

7 years agoFix mixed include of GC public header and gc_priv.h in disclaim bench/test
Ivan Maidanski [Thu, 30 Mar 2017 19:06:09 +0000 (22:06 +0300)]
Fix mixed include of GC public header and gc_priv.h in disclaim bench/test

Include gc_priv.h should be avoided in tests (if possible) or, at
least, this include should not precede include of the public GC
headers (because, e.g., gc_priv.h define GC_BUILD which influences
declspec of the GC public symbols in case of a shared library).

* tests/disclaim_bench.c: Move include gc_priv.h to be after
gc_disclaim.h; add comment.
* tests/disclaim_bench.c [HAVE_CONFIG_H]: Include "config.h" (before
include gc_disclaim.h).

7 years agoFix GC_SIZE_MAX definition (Linux/musl-gcc)
Ivan Maidanski [Tue, 14 Mar 2017 22:58:41 +0000 (01:58 +0300)]
Fix GC_SIZE_MAX definition (Linux/musl-gcc)
(Cherry-pick commit f40fab8 from 'release-7_6' branch.)

* include/private/gc_priv.h [SIZE_MAX] (GC_SIZE_MAX): Cast
SIZE_MAX to size_t explicitly (to workaround incorrect definition
of SIZE_MAX - e.g. it is defined as ~0ULL in musl-tools which is not
correct for a 32-bit target).

7 years agoFix gc.h compliance to strict ANSI (pthreads)
Ivan Maidanski [Thu, 30 Mar 2017 21:11:04 +0000 (00:11 +0300)]
Fix gc.h compliance to strict ANSI (pthreads)
(Cherry-pick commits 15542970970110 from 'master' branch.)

If -std=cXX option is passed to gcc/clang then sigset_t is undefined,
thus GC_pthread_sigmask declaration should be omitted.  However, this
symbol should be available during GC source code audit by cppcheck.

* include/gc_pthread_redirects.h [!GC_NO_PTHREAD_SIGMASK]
(GC_pthread_sigmask): Declare only if GC_PTHREAD_SIGMASK_NEEDED or
_POSIX_C_SOURCE >= 199506 or _XOPEN_SOURCE >= 500, or _BSD_SOURCE
or _GNU_SOURCE.
* tests/test.c [CPPCHECK && !_GNU_SOURCE && GC_PTHREADS] (_GNU_SOURCE):
Likewise.

7 years agoFix finalize.c compilation in 'strict ANSI' mode
Ivan Maidanski [Thu, 23 Mar 2017 20:12:07 +0000 (23:12 +0300)]
Fix finalize.c compilation in 'strict ANSI' mode

This and some other GC .c files include gc_pmark.h directly (not
gc_priv.h), so the compiler complains that sigset_t (used in
gc_pthread_redirects.h) is undefined if 'strict ANSI' mode is on and
_GNU_SOURCE is not defined before including system headers.

* include/private/gc_pmark.h [(__linux__ || __GLIBC__ || __GNU__)
&& GC_PTHREADS && !GC_NO_PTHREAD_SIGMASK] (_GNU_SOURCE): Define (before
including other headers).

7 years agoFix static assertion violation in LONG_MULT for 64-bit targets
Ivan Maidanski [Thu, 23 Mar 2017 19:44:11 +0000 (22:44 +0300)]
Fix static assertion violation in LONG_MULT for 64-bit targets

* include/private/gc_pmark.h [MARK_BIT_PER_OBJ] (PUSH_CONTENTS_HDR):
Cast displ to unsigned32 when passed to LONG_MULT (it is safe because
displ is less than HBLKSIZE).

7 years agoFix tools/setjmp_t hang (OS X)
Ivan Maidanski [Thu, 23 Mar 2017 00:16:12 +0000 (03:16 +0300)]
Fix tools/setjmp_t hang (OS X)

* tools/setjmp_t.c (main): Declare "y" static variable as volatile (to
prevent reordering/optimization of y++).

7 years agoFix gctest thread stack overflow (musl-gcc)
Ivan Maidanski [Fri, 17 Mar 2017 07:39:57 +0000 (10:39 +0300)]
Fix gctest thread stack overflow (musl-gcc)
(Cherry-pick commits 3bfeb8a21b68ca from 'master' branch.)

* tests/test.c (BIG): Remove commented out defined(MSWIN32); define
to 1000 if NO_GETCONTEXT (and UNIX_LIKE); update comment.

7 years agoFix 'ISO C90 forbids mixed declarations/code' compiler warning (gc_pmark)
Ivan Maidanski [Mon, 13 Mar 2017 21:31:08 +0000 (00:31 +0300)]
Fix 'ISO C90 forbids mixed declarations/code' compiler warning (gc_pmark)

* include/private/gc_pmark.h [MARK_BIT_PER_OBJ] (PUSH_CONTENTS_HDR):
Declare "obj_displ" local variable at the beginning of the block (not
after GC_STATIC_ASSERT).

7 years agoMove libraries version info to the beginning of Makefile.am
Ivan Maidanski [Wed, 1 Mar 2017 08:10:00 +0000 (11:10 +0300)]
Move libraries version info to the beginning of Makefile.am
(code refactoring)

* Makefile.am (LIBGC_VER_INFO, LIBGCCPP_VER_INFO): New variable; add
comment about the version update rule.
* cord/cord.am (LIBCORD_VER_INFO): Likewise.
* Makefile.am (libgc_la_LDFLAGS, libgccpp_la_LDFLAGS): Use
LIBGC[CPP]_VER_INFO instead the direct hard-coding of version info.
* cord/cord.am (libcord_la_LDFLAGS): Likewise.

7 years agoUpdate AUTHORS file
Max Mouratov [Wed, 1 Mar 2017 03:12:14 +0000 (08:12 +0500)]
Update AUTHORS file

7 years agoFix typo in comment at GC_setup_temporary_fault_handler declaration
Ivan Maidanski [Thu, 23 Mar 2017 00:24:49 +0000 (03:24 +0300)]
Fix typo in comment at GC_setup_temporary_fault_handler declaration

* include/private/gc_priv.h (GC_setup_temporary_fault_handler): Fix typo
in comment (replace trailing ';' with a dot).

7 years agoFix name typos in GC_FAST_MALLOC_GRANS comment
Ivan Maidanski [Tue, 28 Feb 2017 21:45:45 +0000 (00:45 +0300)]
Fix name typos in GC_FAST_MALLOC_GRANS comment

* include/gc_inline.h (GC_FAST_MALLOC_GRANS): Fix typos in names in
comment ("num_direct", "generic_malloc").

7 years agoFix typo in GC_AMIGA_GC documentation in README
Ivan Maidanski [Mon, 20 Feb 2017 21:32:49 +0000 (00:32 +0300)]
Fix typo in GC_AMIGA_GC documentation in README

* doc/README.amiga (GC_AMIGA_GC): Fix a typo ("very").

7 years agoUpdate AUTHORS file
Ivan Maidanski [Mon, 20 Feb 2017 21:25:29 +0000 (00:25 +0300)]
Update AUTHORS file

7 years agoFix various typos in comments and printed messages
Klemens Zwischenbrugger [Mon, 20 Feb 2017 21:17:57 +0000 (00:17 +0300)]
Fix various typos in comments and printed messages

This patch contains some spelling fixes (just in comments and C strings
passed to printf) as found by bot (https://github.com/ka7/misspell_fixer).

* SMakefile.amiga: Fix typo in comment ("don't").
* WCC_MAKEFILE (SYSTEM): Fix typo in comment ("uncomment").
* configure.ac [!GCC] (gc_cflags): Fix typo in comment ("actually").
* configure.ac (NO_CLOCK): Fix typo in comment ("targeting").
* doc/README.amiga: Fix typos in documentation ("there's", "compliant",
"documentation").
* extra/AmigaOS.c [GC_AMIGA_PRINTSTATS] (GC_amiga_free_all_mem): Fix
typos in printed messages ("succeeded", "succeeding").
* include/gc.h (GC_get_heap_size): Fix typo in comment ("below").
* tools/setjmp_t.c (main): Fix typo in printed message ("won't").

7 years agoFix typo in Makefile.am comment
Ivan Maidanski [Wed, 15 Feb 2017 08:56:06 +0000 (11:56 +0300)]
Fix typo in Makefile.am comment

* Makefile.am (SUBDIRS): Fix typo in comment ("to be").

7 years ago.gitignore: Ignore gctest_* and lib*gc.so produced by Makefile.direct
Ivan Maidanski [Wed, 22 Mar 2017 08:31:16 +0000 (11:31 +0300)]
.gitignore: Ignore gctest_* and lib*gc.so produced by Makefile.direct

7 years ago.gitignore: Ignore bsd-libgc.a, bsd-libleak.a
Ivan Maidanski [Mon, 20 Mar 2017 20:10:48 +0000 (23:10 +0300)]
.gitignore: Ignore bsd-libgc.a, bsd-libleak.a

7 years ago.gitignore: Ignore *.sancov (generated by ASan)
Ivan Maidanski [Wed, 15 Feb 2017 21:42:22 +0000 (00:42 +0300)]
.gitignore: Ignore *.sancov (generated by ASan)

7 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Fri, 10 Feb 2017 11:18:00 +0000 (14:18 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

7 years agoTravis CI: test also without --enable-munmap
Ivan Maidanski [Tue, 7 Feb 2017 08:44:57 +0000 (11:44 +0300)]
Travis CI: test also without --enable-munmap

7 years agoTravis CI: test --enable-gc-assertions
Ivan Maidanski [Tue, 7 Feb 2017 08:19:59 +0000 (11:19 +0300)]
Travis CI: test --enable-gc-assertions

7 years agoTravis CI: Test --disable-static --disable-threads
Ivan Maidanski [Thu, 2 Feb 2017 19:47:52 +0000 (22:47 +0300)]
Travis CI: Test --disable-static --disable-threads
(Cherry-pick commit 7f29567 from 'master' branch.)

7 years agoTravis CI: Test also --disable-gc-debug and --enable-large-config
Ivan Maidanski [Thu, 2 Feb 2017 19:13:42 +0000 (22:13 +0300)]
Travis CI: Test also --disable-gc-debug and --enable-large-config
(Cherry-pick commit 823a32f from 'master' branch.)

7 years agoTravis CI configuration: test also pointer backtracing
Ivan Maidanski [Mon, 28 Nov 2016 10:11:35 +0000 (13:11 +0300)]
Travis CI configuration: test also pointer backtracing
(Cherry-pick commits 3130765b475ea9 from 'master' branch.)

7 years agoTravis CI configuration: also build and test C++
Ivan Maidanski [Mon, 28 Nov 2016 06:46:28 +0000 (09:46 +0300)]
Travis CI configuration: also build and test C++
(Cherry-pick part of commits f2b0f7f6c48bae7807132 from 'master'.)

Note: libgccpp and test_cpp are disabled for Linux/x86 builds currently.

7 years agoTravis CI: compile both for x86 and x64
Ivan Maidanski [Sun, 29 Jan 2017 05:51:30 +0000 (08:51 +0300)]
Travis CI: compile both for x86 and x64
(Cherry-pick part of commits caa4a796c48bae64eb548 from 'master'.)

7 years agoTravis CI: Exclude osx/gcc builds
Ivan Maidanski [Sun, 29 Jan 2017 05:39:43 +0000 (08:39 +0300)]
Travis CI: Exclude osx/gcc builds
(gcc is an alias to clang on OS X)

7 years agoFix enable_parallel_mark condition in CMake script
Ivan Maidanski [Tue, 31 Jan 2017 23:30:18 +0000 (02:30 +0300)]
Fix enable_parallel_mark condition in CMake script

* CMakeLists.txt [enable_parallel_mark] (ADD_DEFINITIONS): Add
-DPARALLEL_MARK; remove ADD_DEFINITIONS("-DPARALLEL_MARK") in other
places; remove ${} for enable_parallel_mark in IF.

7 years agoAppveyor CI: build/test with GCJ support
Ivan Maidanski [Thu, 26 Jan 2017 07:53:32 +0000 (10:53 +0300)]
Appveyor CI: build/test with GCJ support
(Cherry-pick commit ad57086 from 'master' branch.)

7 years agoAdd configure --enable-gcov option (enable code coverage analysis)
Ivan Maidanski [Wed, 18 Jan 2017 08:47:44 +0000 (11:47 +0300)]
Add configure --enable-gcov option (enable code coverage analysis)

* configure.ac (gcov): New --enable-* option.
* configure.ac [enable_gcov] (CFLAGS): Add "--coverage" option.
* configure.ac [enable_gcov && !enable_shared] (CXXFLAGS): Add
"--coverage" option (the shared library build is skipped to workaround
a bug in GCC or linker, atlist for gcc-4.8.4/x86_64).
* configure.ac [enable_gcov] (CFLAGS, CXXFLAGS): Filter out compiler
"-O" options (except for -O0).

7 years agoSupport CFLAGS_EXTRA to pass extra user-defined compiler flags (configure)
Ivan Maidanski [Fri, 9 Dec 2016 00:21:05 +0000 (03:21 +0300)]
Support CFLAGS_EXTRA to pass extra user-defined compiler flags (configure)

* Makefile.am (CFLAGS, CXXFLAGS): Append $(CFLAGS_EXTRA).
* configure.ac: Add AC_SUBST(CFLAGS_EXTRA).

7 years agoWorkaround 'index out of bounds' UBSan false warning in push_marked
Ivan Maidanski [Fri, 9 Dec 2016 23:07:25 +0000 (02:07 +0300)]
Workaround 'index out of bounds' UBSan false warning in push_marked

* mark.c (GC_push_marked): Cast (h+1)->hb_body to word before
subtraction of sz value (and cast the result back to ptr_t).
* mark.c [ENABLE_DISCLAIM] (GC_push_unconditionally): Likewise.

7 years agoFix MS VC warning about compiling unused checksums and thread_local_alloc
Ivan Maidanski [Tue, 31 Jan 2017 23:21:22 +0000 (02:21 +0300)]
Fix MS VC warning about compiling unused checksums and thread_local_alloc

* CMakeLists.txt (SRC): Remove checksums.c (to avoid MS VC warning
about unused file).
* CMakeLists.txt (SRC): Do not add thread_local_alloc.c unless
ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC") present.

7 years agoFix 'zero-size array is extension' Clang warning in os_dep (Linux/x86)
Ivan Maidanski [Mon, 30 Jan 2017 03:51:12 +0000 (06:51 +0300)]
Fix 'zero-size array is extension' Clang warning in os_dep (Linux/x86)

* os_dep.c [I386 && LINUX && SAVE_CALL_CHAIN] (struct frame): Do not
declare fr_arg[NARGS] field if NARGS is zero.

7 years agoFix 'execvp argument incompatible pointer type' compiler warning (tools)
Ivan Maidanski [Mon, 9 Jan 2017 21:03:07 +0000 (00:03 +0300)]
Fix 'execvp argument incompatible pointer type' compiler warning (tools)

* tools/if_mach.c (main): Cast the 2nd argument of execvp to void* (to
avoid compiler warning as the argument of execvp() prototype could be
of "const char* const*" or "char**" type).
* tools/if_not_there.c (main): Likewise.

7 years agoSuppress 'tainted string passed to vulnerable operation' false defects
Ivan Maidanski [Tue, 15 Nov 2016 07:48:31 +0000 (10:48 +0300)]
Suppress 'tainted string passed to vulnerable operation' false defects

* include/private/gc_priv.h (TRUSTED_STRING): New tagging macro; add
comment.
* misc.c (GC_init): Process the result of GETENV("GC_LOG_FILE") by
TRUSTED_STRING.
* tools/if_mach.c (main): Process argv[3] by TRUSTED_STRING (before
passing the string to execvp).
* tools/if_not_there.c (main): Declare "fname" local variable;
process argv[1] and argv[2] by TRUSTED_STRING (before passing the
strings to fopen/opendir and execvp, respectively).

7 years agoFix (adjust) GC_scratch_alloc actual argument type
Ivan Maidanski [Tue, 20 Dec 2016 07:21:07 +0000 (10:21 +0300)]
Fix (adjust) GC_scratch_alloc actual argument type

* dyn_load.c [IRIX5 || USE_PROC_FOR_LIBRARIES && !LINUX]
(GC_register_dynamic_libraries): Do not cast GC_scratch_alloc argument
to word type (it should be of size_t).
* headers.c (alloc_hdr, GC_init_headers, get_index): Likewise.
* os_dep.c [PROC_VDB] (GC_proc_buf_size): Change type from word to size_t.
* os_dep.c [PROC_VDB] (GC_read_dirty): Change type of new_size local
variable (which is passed to GC_scratch_alloc) from word to size_t.

7 years agoFix 'context local variable might be clobbered by setjmp' compiler warning
Ivan Maidanski [Mon, 5 Dec 2016 23:21:33 +0000 (02:21 +0300)]
Fix 'context local variable might be clobbered by setjmp' compiler warning

* mach_dep.c (GC_with_callee_saves_pushed): Mark "context" local
variable as volatile (to prevent it from potential clobbering).

7 years agowindows-untested: Fix paths to gc_version.h
Ivan Maidanski [Wed, 11 Jan 2017 21:19:24 +0000 (00:19 +0300)]
windows-untested: Fix paths to gc_version.h

* windows-untested/gc.ver: Include gc_version.h instead of ../version.h.
* windows-untested/vc60/gc.dsp (SOURCE): Replace version.h with
include\gc_version.h.
* windows-untested/vc60/libgc.dsp (SOURCE): Likewise.
* windows-untested/vc60/libgcmt.dsp (SOURCE): Likewise.
* windows-untested/vc70/gc.vcproj (Filter.File): Likewise.
* windows-untested/vc70/libgc.vcproj (Filter.File): Likewise.
* windows-untested/vc70/libgcmt.vcproj (Filter.File): Likewise.
* windows-untested/vc71/gc.vcproj (Filter.File): Likewise.
* windows-untested/vc71/libgc.vcproj (Filter.File): Likewise.
* windows-untested/vc71/libgcmt.vcproj (Filter.File): Likewise.

7 years agoFix GCJ support in CMake build script
Ivan Maidanski [Wed, 25 Jan 2017 20:52:53 +0000 (23:52 +0300)]
Fix GCJ support in CMake build script
(Cherry-pick part of commit 29d5a7e from 'release-7_6' branch.)

* CMakeLists.txt [enable_gcj_support] (SRC): Add gcj_mlc.c.

7 years agoFix lack of 2 trailing zeros in _MSC_VER numbers
Ivan Maidanski [Mon, 16 Jan 2017 21:14:44 +0000 (00:14 +0300)]
Fix lack of 2 trailing zeros in _MSC_VER numbers

_MSC_VER value consists of 4 digits (as of VS 2015).

* include/gc_config_macros.h [!GC_ATTR_MALLOC && !__GNUC__ && _MSC_VER]
(GC_ATTR_MALLOC): Replace _MSC_VER>=14 with _MSC_VER>=1400.
* include/private/gc_priv.h [!__GNUC__ && _MSC_VER] (GC_ATTR_NOINLINE):
Likewise.
* include/gc_config_macros.h [!GC_BUILD && !__GNUC__ && _MSC_VER]
(GC_ATTR_DEPRECATED): Replace _MSC_VER>=12 with _MSC_VER>=1200.

7 years agoFix GC_noop6 definition to avoid its calls to be optimized away
Ivan Maidanski [Mon, 12 Dec 2016 23:34:28 +0000 (02:34 +0300)]
Fix GC_noop6 definition to avoid its calls to be optimized away
(fix commits e3ec4a51586a21)

* include/private/gc_priv.h (GC_ATTR_NOINLINE): New macro (effective
for GCC/Clang and MS VC currently).
* mark.c (GC_noop6): Use GC_ATTR_NOINLINE attribute; call
AO_compiler_barrier if PARALLEL_MARK (or GC_PTHREADS and not
GC_WIN32_THREADS), otherwise call GC_noop1(0); add
comment.

7 years agoFix Makefile.direct recursive invocation
Ivan Maidanski [Mon, 9 Jan 2017 07:29:29 +0000 (10:29 +0300)]
Fix Makefile.direct recursive invocation

* Makefile.direct (bsd-libgc.a): Add "-f Makefile.direct" option.

7 years agoFix bm_huge initialization for 64-bit targets (gctest)
Ivan Maidanski [Thu, 22 Dec 2016 21:39:10 +0000 (00:39 +0300)]
Fix bm_huge initialization for 64-bit targets (gctest)

* tests/test.c (bm_huge): Make array size depend on word size
(5 elements for 64-bit targets); initialize elements (except the last
one) to -1 instead of 0xffffffff (so that all bits are ones even on
a 64-bit target); initialize last element to ((word)-1)>>8 instead of
0x00ffffff value.
* tests/test.c (typed_test): Fail if bm_huge descriptor contains wrong
bit values at certain positions (as it had before this fix).