]> granicus.if.org Git - gc/log
gc
8 years agoEliminate 'suspicious pointer subtraction' cppcheck warning (gc_cpp)
Ivan Maidanski [Wed, 26 Oct 2016 08:13:29 +0000 (11:13 +0300)]
Eliminate 'suspicious pointer subtraction' cppcheck warning (gc_cpp)

* include/gc_cpp.h (gc_cleanup::gc_cleanup): Define this_ptr void
pointer; use this_ptr instead of this keyword to outline that the
pointer subtraction is intentional (i.e., "this->" was not intended).

8 years agoEliminate unreachable PROC/DEFAULT_VDB GC_printf calls in gctest main()
Ivan Maidanski [Wed, 26 Oct 2016 08:44:37 +0000 (11:44 +0300)]
Eliminate unreachable PROC/DEFAULT_VDB GC_printf calls in gctest main()

* tests/test.c [!GC_WIN32_THREADS && !GC_PTHREADS && !NO_INCREMENTAL
&& (MPROTECT_VDB || PROC_VDB || GWW_VDB) && !MAKE_BACK_GRAPH &&] (main):
Remove unreachable GC_printf call about DEFAULT_VDB; remove extra check
of GWW_VDB case.
* tests/test.c [GC_PTHREADS && MPROTECT_VDB && !REDIRECT_MALLOC
&& !MAKE_BACK_GRAPH && !USE_PROC_FOR_LIBRARIES && !NO_INCREMENTAL]
(main): Remove extra check of MPROTECT_VDB case; remove unreachable
GC_printf calls about PROC_VDB and DEFAULT_VDB.

8 years agoEliminate 'value of CLOCK_TYPE unknown' cppcheck info message
Ivan Maidanski [Fri, 21 Oct 2016 20:34:41 +0000 (23:34 +0300)]
Eliminate 'value of CLOCK_TYPE unknown' cppcheck info message

* tests/disclaim_bench.c (main): Replace #ifdef CLOCK_TYPE
with #ifndef NO_CLOCK.

8 years agoFix 'ISO C90 does not support %lf, %lg gnu_printf formats' GCC warnings
Ivan Maidanski [Fri, 21 Oct 2016 19:11:09 +0000 (22:11 +0300)]
Fix 'ISO C90 does not support %lf, %lg gnu_printf formats' GCC warnings

* tests/disclaim_bench.c (main): Replace "%lf" printf format specifier
to "%f" one, and "%lg" one to "%g" one.

8 years agoFix 'ISO C90 forbids mixed declarations and code' compiler warning
Ivan Maidanski [Fri, 21 Oct 2016 08:42:26 +0000 (11:42 +0300)]
Fix 'ISO C90 forbids mixed declarations and code' compiler warning

* pthread_support.c [GC_PTHREADS && !GC_WIN32_THREADS]
(GC_thread_exit_proc): Move GC_log_printf() call down to be after local
variables declarations.
* thread_local_alloc.c [THREAD_LOCAL_ALLOC && USE_PTHREAD_SPECIFIC
&& !USE_WIN32_SPECIFIC]: Add {} to have "k" local variable declaration
before any statement in a block.

8 years agoFix local variable declarations in disclaim_bench
Ivan Maidanski [Wed, 19 Oct 2016 08:09:33 +0000 (11:09 +0300)]
Fix local variable declarations in disclaim_bench

* tests/disclaim_bench.c (main): Place (move) tI, tF local variable
declarations (in the block) before any statement.

8 years agoFix typo in CHECK_GCLIB_VERSION name (test)
Ivan Maidanski [Thu, 13 Oct 2016 08:37:21 +0000 (11:37 +0300)]
Fix typo in CHECK_GCLIB_VERSION name (test)

* tests/test.c (CHECK_GCLIB_VERSION): Fix typo in macro name.

8 years agoWorkaround 'resource leak' error reported by cppcheck (tools, test)
Ivan Maidanski [Thu, 13 Oct 2016 08:33:17 +0000 (11:33 +0300)]
Workaround 'resource leak' error reported by cppcheck (tools, test)

* tests/test.c [GC_GCJ_SUPPORT && TEST_WITH_SYSTEM_MALLOC] (reverse):
Call GC_noop1 for malloc() result.
* tools/if_not_there.c (main): Move "f" local variable assignments
outside conditional expression.

8 years agoEliminate 'potential overflow' static analyzer warning in test
Ivan Maidanski [Tue, 4 Oct 2016 07:28:18 +0000 (10:28 +0300)]
Eliminate 'potential overflow' static analyzer warning in test

* tests/subthread_create.c (entry): Replace (int)(int_v1 - uint_v2)
expression with int_v1 - (int)uint_v2.

8 years agoCode refactoring of tests/subthread_create regarding AO add primitive
Ivan Maidanski [Thu, 29 Sep 2016 21:16:43 +0000 (00:16 +0300)]
Code refactoring of tests/subthread_create regarding AO add primitive

* tests/subthread_create.c (entry): Use AO_fetch_and_add1(&v) instead
of AO_fetch_and_add(&v,1).

8 years agoEliminate 'FP divide-by-zero' static analyzer warning
Ivan Maidanski [Thu, 29 Sep 2016 08:02:31 +0000 (11:02 +0300)]
Eliminate 'FP divide-by-zero' static analyzer warning

* tests/disclaim_bench.c (main): Print "N/A" (i.e. do not invoke
printf with t/(double)free_count) if free_count <= 0.

8 years agoFix null dereference in GC_stack_range_for if not DARWIN_DONT_PARSE_STACK
Ivan Maidanski [Wed, 26 Oct 2016 21:31:14 +0000 (00:31 +0300)]
Fix null dereference in GC_stack_range_for if not DARWIN_DONT_PARSE_STACK
(fix commit 4ceae609)

* darwin_stop_world.c (GC_stack_range_for): Use GC_ATTR_UNUSED for
paltstack_hi argument (because the latter is not used currently if
!DARWIN_DONT_PARSE_STACK); do not access p->altstack[_size] unless
DARWIN_DONT_PARSE_STACK; add TODO item.
* darwin_stop_world.c [!DARWIN_DONT_PARSE_STACK] (GC_push_all_stacks):
Do not use altstack_hi and altstack_lo; add TODO item.

8 years agoSkip thread suspend/resume API testing for Tru64 (OSF1)
Ivan Maidanski [Wed, 28 Sep 2016 22:30:42 +0000 (01:30 +0300)]
Skip thread suspend/resume API testing for Tru64 (OSF1)
(fix commit 8ff3262)

OSF1 has GC_retry_signals on by default but this is not supported by
thread suspend/resume API yet.

* tests/test.c [GC_PTHREADS && GC_ENABLE_SUSPEND_THREAD]
(fork_a_thread): Do not test GC_suspend/resume_thread if
GC_OSF1_THREADS.

8 years agoAdd more cases to huge_test to cover sizes close to word-type maximum
Ivan Maidanski [Wed, 28 Sep 2016 21:32:47 +0000 (00:32 +0300)]
Add more cases to huge_test to cover sizes close to word-type maximum

* tests/huge_test.c (GC_WORD_MAX): New macro.
* tests/huge_test.c (GC_SWORD_MAX): Use GC_WORD_MAX.
* tests/huge_test.c (main): Add GC_SWORD_MAX+1, GC_WORD_MAX,
GC_WORD_MAX-4/8/16/1024 test cases.

8 years agoCode refactoring of huge_test
Ivan Maidanski [Tue, 27 Sep 2016 07:47:00 +0000 (10:47 +0300)]
Code refactoring of huge_test

* tests/huge_test.c [!GC_MAXIMUM_HEAP_SIZE] (GC_MAXIMUM_HEAP_SIZE,
GC_INITIAL_HEAP_SIZE): Define (before include gc.h); move the comment
from main().
* tests/huge_test.c (CHECK_ALLOC_FAILED): New macro.
* tests/huge_test.c (main): Remove "r" local variable; do not call
GC_set_max_heap_size and GC_expand_hp explicitly (as it is done
by GC_INIT provided GC_MAXIMUM_HEAP_SIZE and GC_INITIAL_HEAP_SIZE are
defined); use CHECK_ALLOC_FAILED (instead of if/fprintf/exit).

8 years agoEliminate 'C-style pointer casting' cppcheck style warnings in test
Ivan Maidanski [Tue, 13 Sep 2016 18:22:24 +0000 (21:22 +0300)]
Eliminate 'C-style pointer casting' cppcheck style warnings in test

* tests/test_cpp.cc (D::CleanUp, main): Use static_cast instead of
C-style pointer cast.

8 years agoEliminate 'ISO C forbids an empty translation unit' GCC pedantic warning
Ivan Maidanski [Fri, 21 Oct 2016 08:18:22 +0000 (11:18 +0300)]
Eliminate 'ISO C forbids an empty translation unit' GCC pedantic warning

"extern int GC_quiet" is added to suppress compiler warning.

* extra/msvc_dbg.c [_M_AMD64 || !_MSC_VER] (GC_quiet): Declare external
variable.

8 years agoWorkaround 'Uninitialized variable' cppcheck errors
Ivan Maidanski [Tue, 18 Oct 2016 08:39:17 +0000 (11:39 +0300)]
Workaround 'Uninitialized variable' cppcheck errors

* extra/AmigaOS.c [GC_AMIGA_DS] (GC_register_data_segments): Initialize
myseglist outside conditional statement.
* mach_dep.c [GETCONTEXT_FPU_EXCMASK_BUG && X86_64]
(GC_with_callee_saves_pushed): Call GC_noop1(&old_fcw) (before asm
fstcw) if CPPCHECK.
* mach_dep.c [!HAVE_BUILTIN_UNWIND_INIT] (GC_with_callee_saves_pushed):
Replace regs with &regs.
* os_dep.c [!MSWIN32 && !GC_OPENBSD_THREADS && ...]
(GC_get_main_stack_base): Set result to NULL if CPPCHECK but none of
HEURISTIC* and *STACKBOTTOM defined.

8 years agoFix 'variable assigned a value that is never used' cppcheck style warnings
Ivan Maidanski [Mon, 17 Oct 2016 22:42:22 +0000 (01:42 +0300)]
Fix 'variable assigned a value that is never used' cppcheck style warnings

* dyn_load.c [USE_PROC_FOR_LIBRARIES] (GC_register_map_entries): Remove
datastart local variable.
* extra/AmigaOS.c [GC_AMIGA_DS] (GC_register_data_segments): Remove
num local variable.
* extra/MacOS.c (firstTime): Remove.
* extra/MacOS.c (GC_MacTemporaryNewPtr): Do not define firstTime if
SHARED_LIBRARY_BUILD.
* extra/MacOS.c (GC_MacFreeTemporaryMemory): Do not define (and update)
totalMemoryUsed if SHARED_LIBRARY_BUILD.
* extra/msvc_dbg.c (GetDescriptionFromAddress): Do not assign size
variable when its value no longer used.

8 years agoFix printf format specifiers in extra files
Ivan Maidanski [Thu, 29 Sep 2016 21:53:23 +0000 (00:53 +0300)]
Fix printf format specifiers in extra files
(to eliminate cppcheck warnings)

* extra/MacOS.c (GC_MacFreeTemporaryMemory): Cast GC_gc_no to unsigned
long, and adjust fprintf format specifier appropriately.
* extra/msvc_dbg.c (GetDescriptionFromAddress): Cast line_number to
int when passed to wsprintf() to match format specifier.

8 years agoEliminate 'scope of variable can be reduced' cppcheck warnings
Ivan Maidanski [Sat, 27 Aug 2016 05:48:02 +0000 (08:48 +0300)]
Eliminate 'scope of variable can be reduced' cppcheck warnings

* cord/cordbscs.c (CORD_cat_char_star, CORD_from_fn,
CORD_substr_checked, CORD_riter4, CORD_init_min_len): Move local
variable declaration to the inner scope where the variable is used.
* cord/cordxtra.c (CORD_cmp, CORD_ncmp, CORD_from_file_eager): Likewise.
* cord/tests/cordtest.c (test_basics): Likewise.
* cord/tests/de.c (line_pos, replace_line): Likewise.
* dbg_mlc.c (GC_generate_random_heap_address): Likewise.
* mark.c (GC_print_trace_inner): Likewise.
* misc.c (GC_printf): Likewise.
* cord/cordbscs.c (CORD_cat_char_star, CORD_from_fn,
CORD_substr_checked, CORD_riter4, CORD_init_min_len): Remove "register"
keyword for the moved variable.
* cord/cordxtra.c (CORD_cmp, CORD_ncmp, CORD_from_file_eager): Likewise.
* cord/tests/de.c (replace_line): Likewise.

8 years agoEliminate 'unsafe vsprintf is deprecated' compiler warning
Ivan Maidanski [Fri, 28 Oct 2016 06:35:33 +0000 (09:35 +0300)]
Eliminate 'unsafe vsprintf is deprecated' compiler warning

Replacement of vsprintf to vsnprintf (or similar) if available.

Note that no buffer overflow occurs in CORD_vsprintf as buf is
allocated dynamically based on format string.

* cord/cordprnt.c (GC_VSNPRINTF): New macro (the definition is copied
from misc.c).
* cord/cordprnt.c (CORD_vsprintf): Replace vsprintf(buf,...) call with
GC_VSNPRINTF(buf,max_size+1,...).

8 years agoEliminate 'write to memory that was const-qualified' code analyzer warning
Ivan Maidanski [Wed, 28 Sep 2016 08:32:55 +0000 (11:32 +0300)]
Eliminate 'write to memory that was const-qualified' code analyzer warning

* cord/cordbscs.c (CORD_from_fn): Rename to CORD_from_fn_inner; make it
static; change return type from CORD to CordRep*; define public
CORD_from_fn which simply calls CORD_from_fn_inner (with the type cast
to CORD).
* cord/cordbscs.c (CORD_substr_closure): Call CORD_from_fn_inner
instead of CORD_from_fn (thus remove the cast from const type to
a non-const one).

8 years agoEliminate 'checking if unsigned variable is <0' cppcheck style warning
Ivan Maidanski [Mon, 29 Aug 2016 12:58:00 +0000 (15:58 +0300)]
Eliminate 'checking if unsigned variable is <0' cppcheck style warning

* cord/cordbscs.c (CORD_from_fn, CORD_substr): Do not expect size_t
value to be negative (replace <=0 comparison with ==0 one).
* cord/cordxtra.c (CORD_cmp): Likewise.
* cord/cordbscs.c (CORD_substr): Remove obsolete comment (about SunOS 4
which had signed size_t type).

8 years agoEliminate 'possible integer underflow' code defect (cord-de)
Ivan Maidanski [Thu, 27 Oct 2016 21:58:21 +0000 (00:58 +0300)]
Eliminate 'possible integer underflow' code defect (cord-de)

* cord/tests/de.c (generic_init): Replace initial==CORD_EMPTY check
with 0==len where len is CORD_len(initial) (to outline that len-1
cannot cause underflow).

8 years agoWorkaround 'pos_*, [r]iter, dump never used' cppcheck style warnings (cord)
Ivan Maidanski [Thu, 27 Oct 2016 09:04:41 +0000 (12:04 +0300)]
Workaround 'pos_*, [r]iter, dump never used' cppcheck style warnings (cord)

* cord/tests/cordtest.c [CPPCHECK] (CORD_iter, CORD_next,
CORD_pos_fetch, CORD_pos_to_cord, CORD_pos_to_index, CORD_pos_valid,
CORD_prev): Undefine (at the beginning of the file).
* cord/tests/cordtest.c [CPPCHECK] (test_basics): Call CORD_pos_to_cord,
CORD_pos_to_index, CORD_iter, CORD_riter, CORD_dump; add TODO item.

8 years agoEliminate 'CORD_*printf is never used' cppcheck style warnings (cordtest)
Ivan Maidanski [Thu, 27 Oct 2016 08:24:26 +0000 (11:24 +0300)]
Eliminate 'CORD_*printf is never used' cppcheck style warnings (cordtest)

Minimal testing of CORD_[v][f]printf is added to cordtest.

* cord/tests/cordtest.c: Include stdarg.h.
* cord/tests/cordtest.c: Reformat the comment describing cordtest.
* cord/tests/cordtest.c (wrap_vprintf, wrap_vfprintf): New function
(calling CORD_v[f]printf).
* cord/tests/cordtest.c (test_printf): Call CORD_printf, wrap_vfprintf,
wrap_vprintf for CORD_EMPTY (with the output to stdout); add TODO item.

8 years agoFix conditional expression in pos_fetch, next non-macro definitions (cord)
Ivan Maidanski [Wed, 26 Oct 2016 21:55:22 +0000 (00:55 +0300)]
Fix conditional expression in pos_fetch, next non-macro definitions (cord)

* cord/cordbscs.c (CORD_pos_fetch, CORD_next): Match the conditional
expression of the macro definition (of the same name) in cord_pos.h.

8 years agoFix CORD_substr_closure for the case when CORD_from_fn returns C string
Ivan Maidanski [Wed, 28 Sep 2016 07:27:12 +0000 (10:27 +0300)]
Fix CORD_substr_closure for the case when CORD_from_fn returns C string

* cord/cordbscs.c (CORD_substr_closure): Change type of "result" local
variable from CORD to CordRep* (insert necessary type casts); update
function.header only if function.null field is zero (i.e. CORD_from_fn
returned pointer to CordRep, not a pointer to C character string).

8 years agoFix GC_bytes_allocd incrementation in case of allocation failure
Ivan Maidanski [Tue, 27 Sep 2016 17:05:19 +0000 (20:05 +0300)]
Fix GC_bytes_allocd incrementation in case of allocation failure

* malloc.c (GC_generic_malloc_inner,
GC_generic_malloc_inner_ignore_off_page, GC_generic_malloc): Increment
GC_bytes_allocd only if the allocation successful (op != NULL).
* mallocx.c (GC_generic_malloc_ignore_off_page): Likewise.

8 years agoFix 'label cannot be reached' static analyzer warning in disclaim_test
Ivan Maidanski [Tue, 27 Sep 2016 17:23:19 +0000 (20:23 +0300)]
Fix 'label cannot be reached' static analyzer warning in disclaim_test

* disclaim_test.c (GROW_LIMIT): Define to MUTATE_CNT/10 (instead of
10000000), so that it is always less than MUTATE_CNT (thus
i > GROW_LIMIT is not always false, thus all switch cases are
reachable).

8 years agoFix page calculation in checksums
Ivan Maidanski [Fri, 23 Sep 2016 06:39:18 +0000 (09:39 +0300)]
Fix page calculation in checksums

While consistent use of rounding mode for computing GC_faulted entries
is ok, the proper way of getting page number of an address is just to
clear the lowest bits of the latter.

* checksums.c (GC_record_fault, GC_was_faulted): Do not round-up when
computing page.
* checksums.c (GC_record_fault): Add assertion that GC_page_size is
initialized.

8 years agoFix typo in comment of GC_lock (Win32)
Ivan Maidanski [Mon, 19 Sep 2016 21:18:28 +0000 (00:18 +0300)]
Fix typo in comment of GC_lock (Win32)

* win32_threads.c [USE_PTHREAD_LOCKS] (GC_lock): Fix typo in comment
("pthread_mutex_trylock").

8 years agoFix double multiplication of lb by n in calloc_explicitly_typed
Ivan Maidanski [Thu, 15 Sep 2016 06:47:23 +0000 (09:47 +0300)]
Fix double multiplication of lb by n in calloc_explicitly_typed

* typd_mlc.c (GC_calloc_explicitly_typed): Do not multiply lb by n
twice (when passed to GC_malloc in case of
GC_general_register_disappearing_link fails).

8 years agoWorkaround 'va_list used before va_start' cppcheck error in cord
Ivan Maidanski [Mon, 12 Sep 2016 18:55:25 +0000 (21:55 +0300)]
Workaround 'va_list used before va_start' cppcheck error in cord

Note that -D CPPCHECK should be passed to cppcheck to activate
this workaround.

* cord/cordprnt.c (CORD_vsprintf) [CPPCHECK]: Force to use va_copy
and va_end.
* cord/cordprnt.c (CORD_vsprintf): Set res to -1 if invalid format
specifier (instead of immediate return -1); call va_end at a single
place.

8 years agoEliminate 'condition is always true' cppcheck style warning
Ivan Maidanski [Mon, 29 Aug 2016 12:25:26 +0000 (15:25 +0300)]
Eliminate 'condition is always true' cppcheck style warning

* cord/cordprnt.c (CORD_vsprintf): Comment out always-true expression
about long_arg.

8 years agoEliminate 'value stored is never read' warning of Clang static analyzer
Ivan Maidanski [Fri, 26 Aug 2016 06:49:30 +0000 (09:49 +0300)]
Eliminate 'value stored is never read' warning of Clang static analyzer

* tools/setjmp_t.c (g): Declare (before "main").
* tools/setjmp_t.c (main): Call g(x) to use "x" variable value
after x=2.

8 years agoFix Clang static analyzer warning about not found gc_priv.h in extra files
Ivan Maidanski [Fri, 26 Aug 2016 06:41:35 +0000 (09:41 +0300)]
Fix Clang static analyzer warning about not found gc_priv.h in extra files

* extra/AmigaOS.c: Include "private/gc_priv.h" instead of "gc_priv.h".
* extra/MacOS.c: Likewise.

8 years agoFix header filename in gcconfig.h comment
Ivan Maidanski [Fri, 26 Aug 2016 06:29:35 +0000 (09:29 +0300)]
Fix header filename in gcconfig.h comment

* include/private/gcconfig.h: Replace include gc_private.h with gc.h
in comment (the header is supposed to be included to declare
GC_stackbottom).

8 years agoEliminate 'cast to void* from int' compiler warnings (Darwin/x64)
Ivan Maidanski [Thu, 18 Aug 2016 22:43:25 +0000 (01:43 +0300)]
Eliminate 'cast to void* from int' compiler warnings (Darwin/x64)

* darwin_stop_world.c (GC_stack_range_for, GC_suspend_thread_list,
GC_stop_world, GC_thread_resume, GC_start_world): Cast thread variable
to pointer via word type.
* darwin_stop_world.c (GC_stop_world): Cast stop_info.mach_thread to
pointer via word type.

8 years agoRefine README about library source downloading
Ivan Maidanski [Thu, 18 Aug 2016 18:34:22 +0000 (21:34 +0300)]
Refine README about library source downloading

* README.md (Download): New section.

8 years agoFix compilation if configured with --enable-werror on OS X
Ivan Maidanski [Wed, 17 Aug 2016 22:15:20 +0000 (01:15 +0300)]
Fix compilation if configured with --enable-werror on OS X

GC_init_dyld uses _dyld_bind_fully_image_containing_address() which
is deprecated starting from OS X 10.5.

* configure.ac (werror): Add -Wno-deprecated-declarations to
WERROR_CFLAGS if host is darwin.

8 years agoFix 'GetVersion deprecated' compiler warning in os_dep (MS VC)
Ivan Maidanski [Wed, 17 Aug 2016 08:15:08 +0000 (11:15 +0300)]
Fix 'GetVersion deprecated' compiler warning in os_dep (MS VC)

* os_dep.c [MSWIN32] (GC_init_win32): Do not call GetVersion if
VS 2013+ or Win64 target (set GC_wnt to true instead).

8 years agoFix 'incompatible pointer' compiler warning in GC_init_dyld (OS X 64-bit)
Ivan Maidanski [Wed, 17 Aug 2016 06:44:31 +0000 (09:44 +0300)]
Fix 'incompatible pointer' compiler warning in GC_init_dyld (OS X 64-bit)

* dyn_load.c (GC_init_dyld): Cast _dyld_register_func_for_add_image
and _dyld_register_func_for_remove_image argument to void compiler
warning about incompatible pointer types; update relevant comment.

8 years agoWorkaround missing getcontext() in Docker osrf/ubuntu_32bit
Ivan Maidanski [Thu, 11 Aug 2016 08:56:44 +0000 (11:56 +0300)]
Workaround missing getcontext() in Docker osrf/ubuntu_32bit

* mach_dep.c [NO_GETCONTEXT] (GC_with_callee_saves_pushed): Call WARN
instead of ABORT if getcontext() failed; do not set context variable
if getcontext() failed; fallback to other register retrieval methods
(__builtin_unwind_init or setjmp) if context variable is NULL.
* mach_dep.c (GC_with_callee_saves_pushed): Reformat code.

8 years agoUpdate AUTHORS file
Ivan Maidanski [Wed, 10 Aug 2016 10:35:52 +0000 (13:35 +0300)]
Update AUTHORS file

8 years agoCMake: add gctest as a test
Andy Li [Sat, 6 Aug 2016 16:23:11 +0000 (00:23 +0800)]
CMake: add gctest as a test

* CMakeLists.txt: Include CTest.
* tests/CMakeLists.txt: Add gctest as test.

8 years agoFix 'unknown type name GC_INNER' compilation error (FreeBSD)
Ivan Maidanski [Mon, 8 Aug 2016 18:49:20 +0000 (21:49 +0300)]
Fix 'unknown type name GC_INNER' compilation error (FreeBSD)
(fix commit f13a9559)

See issue #132.  The reason of compilation failure is GC_INNER macro
used before its definition.  The solution is to move
GC_FreeBSDGetDataStart prototype from gcconfig.h to gc_priv.h.

* include/private/gc_priv.h [DATASTART_USES_BSDGETDATASTART]
(GC_FreeBSDGetDataStart): Declare.
* include/private/gc_priv.h [DATASTART_USES_BSDGETDATASTART]
(DATASTART_IS_FUNC): Define macro.
* include/private/gcconfig.h [DATASTART_USES_BSDGETDATASTART]
(GC_FreeBSDGetDataStart, DATASTART_IS_FUNC): Remove.

8 years ago[7.6.0] gc7_6_0
Ivan Maidanski [Tue, 2 Aug 2016 20:11:42 +0000 (23:11 +0300)]
[7.6.0]

Bump gc version to 7.6.0

* ChangeLog: Set release date.
* README.md: Bump minor version.
* configure.ac (AC_INIT): Likewise.
* include/gc_version.h (GC_TMP_VERSION_MINOR): Likewise.

8 years agoUpdate ChangeLog file (add gc-7.4.4 release date)
Ivan Maidanski [Tue, 2 Aug 2016 20:02:48 +0000 (23:02 +0300)]
Update ChangeLog file (add gc-7.4.4 release date)

8 years agoUpdate ChangeLog file
Ivan Maidanski [Tue, 2 Aug 2016 09:06:37 +0000 (12:06 +0300)]
Update ChangeLog file

8 years agoDo not allow SHORT_DBG_HDRS if KEEP_BACK_PTRS or MAKE_BACK_GRAPH
Ivan Maidanski [Tue, 2 Aug 2016 09:01:48 +0000 (12:01 +0300)]
Do not allow SHORT_DBG_HDRS if KEEP_BACK_PTRS or MAKE_BACK_GRAPH

Otherwise GC_HAS_DEBUG_INFO (defined as (p&1)) might return true
if a non-pointer is stored at the beginning of the tested object
leading further to its corruption by GC_store_back_pointer.
See issue #125 for details.

* include/private/dbg_mlc.h [KEEP_BACK_PTRS || MAKE_BACK_GRAPH]
(GC_HAS_DEBUG_INFO): Add #error (with the appropriate message) in
case of SHORT_DBG_HDRS defined.

8 years agoDo not report multiple load-seg-overflow warnings per one dl-iterate
Ivan Maidanski [Mon, 1 Aug 2016 19:36:57 +0000 (22:36 +0300)]
Do not report multiple load-seg-overflow warnings per one dl-iterate
(fix commit 017bd0a)

* dyn_load.c [HAVE_DL_ITERATE_PHDR && PT_GNU_RELRO]
(load_segs_overflow): New static variable.
* dyn_load.c [HAVE_DL_ITERATE_PHDR && PT_GNU_RELRO]
(GC_register_dynlib_callback): Do not call WARN if load_segs_overflow;
set load_segs_overflow to true after calling WARN.
* dyn_load.c [HAVE_DL_ITERATE_PHDR && PT_GNU_RELRO]
(GC_register_dynamic_libraries_dl_iterate_phdr): Reset
load_segs_overflow.

8 years agoFix various typos in comments and documentation
Ivan Maidanski [Mon, 1 Aug 2016 07:20:06 +0000 (10:20 +0300)]
Fix various typos in comments and documentation

* doc/README.Mac: Fix typo (replace "it's" to "its").
* doc/debugging.html: Likewise.
* doc/gcdescr.html: Fix typo ("it performs").
* include/private/gcconfig.h: Fix typo in comment ("its").
* mark.c (INITIAL_MARK_STACK_SIZE): Fix typo in comment ("it wants").
* mark.c (GC_mark_from): Fix typo in comment (double "it").
* misc.c (GC_SLOP): Fix typo in comma (double "saw").
* os_dep.c (GC_get_file_len): Fix typo in comment (missing "buffer").
* ptr_chck.c (GC_is_visible): Add missing comma in comment.

8 years agoFix tag collision between ENABLE_DISCLAIM and KEEP_BACK_PTRS
Ivan Maidanski [Thu, 28 Jul 2016 09:06:42 +0000 (12:06 +0300)]
Fix tag collision between ENABLE_DISCLAIM and KEEP_BACK_PTRS

* fnlz_mlc.c (FINALIZER_CLOSURE_FLAG): New macro (defined to 0x2 in
case KEEP_BACK_PTRS or MAKE_BACK_GRAPH, otherwise to 0x1).
* fnlz_mlc.c (GC_finalized_disclaim, GC_finalized_malloc): Use
FINALIZER_CLOSURE_FLAG instead of 0x1.

8 years agoProcess all PT_LOAD segments before PT_GNU_RELRO segments (Glibc)
Kjetil Matheussen [Wed, 27 Jul 2016 08:14:57 +0000 (11:14 +0300)]
Process all PT_LOAD segments before PT_GNU_RELRO segments (Glibc)

This is needed in case a PT_GNU_RELRO segment is placed before its
corresponding PT_LOAD segments.  (It might be that this is guaranteed
never to be the case, but at least this way we do not have to worry
about it.)

* dyn_load.c [HAVE_DL_ITERATE_PHDR] (GC_register_dynlib_callback):
Process PT_LOAD segments in a separate pass before PT_GNU_RELRO ones;
replace FIXME with TODO; reformat code.

8 years agoRemove unused GC_gcjdebugobjfreelist
Ivan Maidanski [Tue, 26 Jul 2016 06:17:29 +0000 (09:17 +0300)]
Remove unused GC_gcjdebugobjfreelist
(code refactoring)

* gcj_mlc.c (GC_gcjdebugobjfreelist): Remove.
* gcj_mlc.c (GC_init_gcj_malloc): Do not store GC_new_free_list_inner
result to GC_gcjdebugobjfreelist.

8 years agoRemove code commented out by 'ifdef UNDEFINED'
Ivan Maidanski [Mon, 25 Jul 2016 17:24:27 +0000 (20:24 +0300)]
Remove code commented out by 'ifdef UNDEFINED'

* finalize.c [UNDEFINED] (GC_invoke_finalizers): Remove
GC_free(curr_fo) call; update comment.
* include/private/gcconfig.h [UNDEFINED] (_etext, DATASTART): Remove.
* typd_mlc.c [UNDEFINED] (GC_make_complex_array_descriptor): Likewise.

8 years agoHandle load_segs overflow in register_dynlib_callback gracefully
Kjetil Matheussen [Sat, 16 Jul 2016 12:43:32 +0000 (14:43 +0200)]
Handle load_segs overflow in register_dynlib_callback gracefully

* dyn_load.c [HAVE_DL_ITERATE_PHDR and PT_GNU_RELRO]
(GC_register_dynlib_callback): If n_load_segs reaches MAX_LOAD_SEGS
then call WARN (with the appropriate message) and call
GC_add_roots_inner to register the segment directly instead of ABORT.

8 years agoUpdate AUTHORS file (update email for Kjetil Matheussen)
Ivan Maidanski [Fri, 22 Jul 2016 17:33:26 +0000 (20:33 +0300)]
Update AUTHORS file (update email for Kjetil Matheussen)

8 years agoDo not warn of missing PT_GNU_RELRO segment when custom DSO filter used
Kjetil Matheussen [Fri, 15 Jul 2016 12:00:26 +0000 (14:00 +0200)]
Do not warn of missing PT_GNU_RELRO segment when custom DSO filter used

It is most likely that it is not found just because the segment had
been excluded.

Alternatively, we could have registered all segments, and checked the
callback afterwards, but then we could break programs that rely on
GC_has_static_roots_func to avoid overflowing the maximum number of
roots.  In addition, it would make the logic slightly more
complicated, probably without a very good reason since the chance of
this warning to show without the segment being excluded is likely to
be none.

* dyn_load.c [HAVE_DL_ITERATE_PHDR] (GC_register_dynlib_callback):
Do not call WARN() if GC_has_static_roots callback is set.

8 years agoFix missing new-line and redundant trailing dot in WARN messages
Ivan Maidanski [Fri, 22 Jul 2016 16:52:34 +0000 (19:52 +0300)]
Fix missing new-line and redundant trailing dot in WARN messages

* allchblk.c (GC_get_first_part, GC_allochblk_nth): Remove '.'
before '\n' in WARN message.
* os_dep.c (GC_read_dirty, GC_mprotect_thread, GC_dirty_init):
Likewise.
* win32_threads.c (GC_start_mark_threads_inner): Likewise.
* alloc.c (GC_collect_or_expand): Remove space before '...' in WARN
message.
* dyn_load.c (GC_register_dynlib_callback): Add '\n' at the end of WARN
message.
* os_dep.c (GC_unix_mmap_get_mem, GC_unix_mmap_get_mem): Likewise.

8 years agoEnable thread-local storage usage for GC_malloc/calloc_explicitly_typed
Thomas Linder Puls [Fri, 22 Jul 2016 08:39:04 +0000 (11:39 +0300)]
Enable thread-local storage usage for GC_malloc/calloc_explicitly_typed

Use GC_malloc_kind instead of explicit allocation algorithm
implementation.

* typd_mlc.c: Include gc_inline.h to declare GC_malloc_kind.
* typd_mlc.c (GC_arobjfreelist): Remove.
* typd_mlc.c (GC_init_explicit_typing): Do not use GC_arobjfreelist.
* typd_mlc.c (GC_malloc_explicitly_typed, GC_calloc_explicitly_typed):
Change type of "op" local variable from ptr_t to word*.
* typd_mlc.c (GC_malloc_explicitly_typed, GC_calloc_explicitly_typed):
Use GC_malloc_kind instead of explicit allocator (those implementation
was same as for GC_malloc_kind).
* typd_mlc.c (GC_calloc_explicitly_typed): Remove"register" keyword for
"descr_type" local variable; reformat code slightly; use EXPECT to
check GC_general_register_disappearing_link result for out-of-memory.

8 years agoUpdate AUTHORS file
Ivan Maidanski [Thu, 21 Jul 2016 19:04:57 +0000 (22:04 +0300)]
Update AUTHORS file

8 years agoCheck for execinfo.h by configure
Mike Frysinger [Sat, 29 Aug 2015 23:14:24 +0000 (19:14 -0400)]
Check for execinfo.h by configure

The current header depends on glibc/uClibc version checks to determine
whether execinfo.h exists which breaks other C libs.  Instead, add an
explicit configure check for it.

* configure.ac: Check execinfo.h presence, define
GC_MISSING_EXECINFO_H otherwise.
* include/gc_config_macros.h [__GLIBC__] (GC_HAVE_BUILTIN_BACKTRACE):
Check absence of GC_MISSING_EXECINFO_H instead of __UCLIBC__.

8 years agoRe-implement GC_finalized_malloc using GC_malloc_kind
Ivan Maidanski [Wed, 20 Jul 2016 22:26:58 +0000 (01:26 +0300)]
Re-implement GC_finalized_malloc using GC_malloc_kind
(code refactoring)

* fnlz_mlc.c: Do not test THREAD_LOCAL_ALLOC; do not include
thread_local_alloc.h.
* fnlz_mlc.c (GC_finalized_objfreelist, GC_core_finalized_malloc):
Remove.
* fnlz_mlc.c [ENABLE_DISCLAIM]: Include gc_inline.h (to declare
GC_malloc_kind).
* fnlz_mlc.c [ENABLE_DISCLAIM] (GC_init_finalized_malloc): Do not use
GC_finalized_objfreelist.
* fnlz_mlc.c [ENABLE_DISCLAIM] (GC_finalized_malloc): Call
GC_malloc_kind (instead of own implementation mostly duplicating the
algorithm of GC_malloc_kind[_global]); change type of "op" local
variable from ptr_t to word*.
* include/private/thread_local_alloc.h [ENABLE_DISCLAIM]
(THREAD_FREELISTS_KINDS): Increase value by 1.
* include/private/thread_local_alloc.h
(thread_local_freelists.finalized_freelists,
GC_finalized_objfreelist): Remove.
* thread_local_alloc.c (GC_finalized_objfreelist): Remove.
* thread_local_alloc.c (GC_init_thread_local, GC_destroy_thread_local,
GC_mark_thread_local_fls_for, GC_check_tls_for): Do not access
finalized_freelists.

8 years agoFix integer shift undefined behavior in GC_init_explicit_typing
Ivan Maidanski [Tue, 19 Jul 2016 22:04:17 +0000 (01:04 +0300)]
Fix integer shift undefined behavior in GC_init_explicit_typing

* typd_mlc.c (GC_init_explicit_typing): Avoid left-shift by WORDSZ
(which is an undefined behavior), initialize GC_bm_table[0] to
GC_DS_BITMAP explicitly.

8 years agoUpdate AUTHORS file
Ivan Maidanski [Tue, 5 Jul 2016 13:22:08 +0000 (16:22 +0300)]
Update AUTHORS file

8 years agoFix assertion in GC_mark_from for non-heap regions
Gabor Drescher [Tue, 5 Jul 2016 07:51:50 +0000 (09:51 +0200)]
Fix assertion in GC_mark_from for non-heap regions

* mark.c (GC_mark_from): Relax assertion condition for descr and
GC_least/greatest_plausible_heap_addr values.

8 years agoUpdate AUTHORS file
Ivan Maidanski [Tue, 5 Jul 2016 11:39:11 +0000 (14:39 +0300)]
Update AUTHORS file

8 years agoMissing volatile in declaration of GC_with_callee_saves_pushed
Thomas Linder Puls [Sun, 3 Jul 2016 22:09:18 +0000 (00:09 +0200)]
Missing volatile in declaration of GC_with_callee_saves_pushed
(fix for commit 8ffc3db)

Otherwise MS VC reports a warning at level 4.

* include/private/gc_priv.h (GC_with_callee_saves_pushed): Add
volatile for arg (to match the function definition).

8 years agoFix 'arg parameter might be clobbered by setjmp' compiler warning
Ivan Maidanski [Fri, 1 Jul 2016 07:41:16 +0000 (10:41 +0300)]
Fix 'arg parameter might be clobbered by setjmp' compiler warning

* mach_dep.c (GC_with_callee_saves_pushed): Make "arg" parameter
volatile (to prevent it from potential clobbering).

8 years agoReplace (fix) 'objs' acronym in comments with 'objects word
Ivan Maidanski [Fri, 1 Jul 2016 07:30:57 +0000 (10:30 +0300)]
Replace (fix) 'objs' acronym in comments with 'objects word

* include/gc.h (GC_PROTECTS_POINTER_HEAP): Replace "objs" word to
"objects" in comment.
* include/private/gc_priv.h (GC_arrays._aobjfreelist,
GC_arrays._uobjfreelist, GC_arrays._auobjfreelist, GC_aobjfreelist):
Likewise.
* mark.c (INITIAL_MARK_STACK_SIZE): Likewise.
* include/private/gc_priv.h (GC_arrays._uobjfreelist): Add missing dot
to delimit the end of a sentence in comment.

8 years agoMerge branch 'generalize-alloc-via-ok_freelist'
Ivan Maidanski [Thu, 30 Jun 2016 07:50:59 +0000 (10:50 +0300)]
Merge branch 'generalize-alloc-via-ok_freelist'

* mark.c (GC_n_kinds): Resolve merge conflict.

8 years agoRevert "Refactoring of GC_Xobjfreelist" partially
Ivan Maidanski [Thu, 30 Jun 2016 07:20:53 +0000 (10:20 +0300)]
Revert "Refactoring of GC_Xobjfreelist" partially

This reverts commit 41871b970c8fd9704835c1a221a8f9f1deea707a partially
(GC_malloc_kind_global, GC_generic_malloc_uncollectable,
GC_destroy_thread_local are not reverted).

8 years agoReplace GC_freelists usage with GC_obj_kinds[].ok_freelist
Ivan Maidanski [Wed, 29 Jun 2016 22:03:54 +0000 (01:03 +0300)]
Replace GC_freelists usage with GC_obj_kinds[].ok_freelist

* malloc.c (GC_malloc_kind_global, GC_generic_malloc_uncollectable):
Use GC_obj_kinds[k].ok_freelist instead of GC_freelists[k].
* thread_local_alloc.c (GC_destroy_thread_local): Likewise.
* thread_local_alloc.c (GC_destroy_thread_local): Stop iteration when
an uninitialized kind reached.

8 years agoRevert "Fix GC_new_kind in case of client-defined PREDEFINED_KINDS"
Ivan Maidanski [Wed, 29 Jun 2016 22:29:02 +0000 (01:29 +0300)]
Revert "Fix GC_new_kind in case of client-defined PREDEFINED_KINDS"

This reverts commit 0d4d41f1e2b12c1321cb37e2bcbe07c8bb089a2d.

8 years agoRevert "Remove redundant comments in GC_obj_kinds"
Ivan Maidanski [Wed, 29 Jun 2016 22:26:58 +0000 (01:26 +0300)]
Revert "Remove redundant comments in GC_obj_kinds"

This reverts commit be76fecc24a410f26ac33fb363cfb90a1ace6fca.

8 years agoFix unchecked fork() result in gctest (Unix, Cygwin)
Ivan Maidanski [Fri, 24 Jun 2016 20:01:53 +0000 (23:01 +0300)]
Fix unchecked fork() result in gctest (Unix, Cygwin)

Fail gctest if forked process failed.

* tests/test.c [!NO_TEST_HANDLE_FORK]: Include sys/types.h, sys/wait.h.
* tests/test.c (run_one_test) [!NO_TEST_HANDLE_FORK]: Declare pid,
wstatus local variables; FAIL if fork() returns -1; call waitpid() for
the child process; FAIL if the child process failed.

8 years agoFix GC_new_kind in case of client-defined PREDEFINED_KINDS
Ivan Maidanski [Sat, 30 Apr 2016 22:07:53 +0000 (01:07 +0300)]
Fix GC_new_kind in case of client-defined PREDEFINED_KINDS

There are 2 types of kinds - "pre-allocated" ones (with the number less
than PREDEFINED_KINDS) which have pre-allocated free lists and object
allocation for these kinds is dealt by GC_malloc_kind typically,
and "custom" kinds which require the client to supply the free list
(e.g., allocated by GC_new_free_list[_inner]) and arrange own object
allocation procedure.
By design, GC_new_kind[_inner] creates new "custom" kind.

* mark.c (GC_N_KINDS_INITIAL_VALUE): Simplify and comment out (for now).
* mark.c (GC_n_kinds): Initialize to PREDEFINED_KINDS (instead of
GC_N_KINDS_INITIAL_VALUE); add TODO item.

8 years agoAdd assertion for GC_new_kind boolean arguments
Ivan Maidanski [Tue, 15 Mar 2016 20:42:43 +0000 (23:42 +0300)]
Add assertion for GC_new_kind boolean arguments

* misc.c (GC_new_kind_inner): Add assertions for "adjust" and "clear"
arguments (should be zero or one).

8 years agoFix assertion violation in GC_wait_builder called from start_mark_threads
Ivan Maidanski [Tue, 21 Jun 2016 20:38:23 +0000 (23:38 +0300)]
Fix assertion violation in GC_wait_builder called from start_mark_threads
(fix commit 0ca6d3f)

* include/private/gc_priv.h [PARALLEL_MARK]
(GC_start_mark_threads_inner): Declare even if no CAN_HANDLE_FORK.
* misc.c [THREADS] (GC_start_mark_threads): Define also for the case
of PARALLEL_MARK and CAN_HANDLE_FORK - call GC_start_mark_threads_inner
surrounded with DISABLE/RESTORE_CANCEL.
* pthread_support.c [PARALLEL_MARK] (GC_start_mark_threads_inner):
Always define as GC_INNER.
* win32_threads.c [GC_PTHREADS_PARAMARK] (GC_start_mark_threads_inner):
Likewise.

8 years agoFix GC_suspend_thread regarding potential cancellation of sem_wait
Ivan Maidanski [Tue, 21 Jun 2016 09:12:56 +0000 (12:12 +0300)]
Fix GC_suspend_thread regarding potential cancellation of sem_wait

* pthread_stop_world.c [GC_ENABLE_SUSPEND_THREAD] (GC_suspend_thread):
Call DISABLE_CANCEL before sem_wait, call RESTORE_CANCEL after it.

8 years agoMerge branch 'thread-suspend'
Ivan Maidanski [Tue, 21 Jun 2016 06:53:04 +0000 (09:53 +0300)]
Merge branch 'thread-suspend'

8 years agoFix GC_suspend_thread for terminated threads
Ivan Maidanski [Tue, 21 Jun 2016 06:48:21 +0000 (09:48 +0300)]
Fix GC_suspend_thread for terminated threads

* pthread_stop_world.c (GC_suspend_thread): Do not clear
SUSPENDED_EXT flag in case of RAISE_SIGNAL() failure, add assertion
about FINISHED (in case of ESRCH), update comment.
* pthread_stop_world.c (GC_register_my_thread): Add assertion
that SUSPENDED_EXT flag is not set if the thread is registered from
a thread key destructor.

8 years agoFix deadlock (and double lock) in explicit thread suspend/resume
Ivan Maidanski [Mon, 20 Jun 2016 08:38:50 +0000 (11:38 +0300)]
Fix deadlock (and double lock) in explicit thread suspend/resume

* pthread_stop_world.c (GC_suspend_handler_inner)
[GC_ENABLE_SUSPEND_THREAD]: If SUSPENDED_EXT flag then set
stop_info.stack_ptr, call sem_post(suspend_ack_sem), and call
suspend_self_inner instead of GC_do_blocking(suspend_self_inner).
* pthread_stop_world.c [GC_ENABLE_SUSPEND_THREAD] (GC_suspend_thread):
No-op if already suspended; UNLOCK before GC_do_blocking (if
self-suspend); add TODO about GC_retry_signals; clear SUSPENDED_EXT
flag if RAISE_SIGNAL failed with ESRCH code; sem_wait(suspend_ack_sem)
to let the suspend handler to lookup the thread and store stack_ptr
(and save registers if needed).
* pthread_stop_world.c (GC_suspend_all, GC_start_world): Skip threads
with SUSPENDED_EXT flag.

8 years agoFix STACKBOTTOM for Solaris 11/x86
Peter Wang [Thu, 16 Jun 2016 09:16:05 +0000 (12:16 +0300)]
Fix STACKBOTTOM for Solaris 11/x86

* include/private/gcconfig.h [I386 && SOLARIS] (STACKBOTTOM,
HEURISTIC2): Define conditionally depening on USERLIMIT - use
HEURISTIC2 if USERLIMIT is undefined (workaround similar to that for
Solaris/sparc and Solaris/x64); include sys/vmparam.h instead of
sys/vm.h; update comment.

8 years agoUpdate AUTHORS file
Ivan Maidanski [Fri, 10 Jun 2016 18:09:54 +0000 (21:09 +0300)]
Update AUTHORS file

8 years agoWorkaround a bug in winpthreads causing parallel marks deadlock (MinGW)
Adrian Pop [Fri, 10 Jun 2016 17:39:18 +0000 (20:39 +0300)]
Workaround a bug in winpthreads causing parallel marks deadlock (MinGW)

The solution is to use Win32 threads for parallel markers while using
winpthreads to provide GC-aware pthread_create/join/detach and fork.

See details in GitHub issue #81 and issue #119.

* win32_threads.c (GC_PTHREADS_PARAMARK): Do not define if
GC_PTHREADS, PARALLEL_MARK and __MINGW32__ (to workaround a deadlock
in do_sema_b_wait() of winpthreads).

8 years agoDump the block information in CSV format
Paul Bone [Fri, 10 Jun 2016 08:11:47 +0000 (11:11 +0300)]
Dump the block information in CSV format

This makes it easy to copy this information into a new file and
process it with tools that understand CSV, e.g. to create histograms
of block utilization.

* reclaim.c (GC_print_block_descr): add n_objs local variable;
separate printed values with a comma; print also size of block in
object units; refactor code for computing total_bytes field.
* reclaim.c (GC_print_block_list): Separate columns in printed table
header with a comma; append "#objs" column to the table.

8 years agoRefactoring of android_thread_kill/pthread_kill calls
Ivan Maidanski [Mon, 30 May 2016 19:46:59 +0000 (22:46 +0300)]
Refactoring of android_thread_kill/pthread_kill calls

* pthread_stop_world.c (android_thread_kill) [USE_TKILL_ON_ANDROID]:
Move definition upper (to be before its first use); remove forward
declaration.
* pthread_stop_world.c (THREAD_SYSTEM_ID, RAISE_SIGNAL): New macro.
* pthread_stop_world.c (GC_suspend_thread): Remove "result" local
variable
* pthread_stop_world.c (GC_suspend_thread, GC_suspend_all,
GC_start_world): Use RAISE_SIGNAL() instead of pthread_kill and
android_thread_kill.
* pthread_stop_world.c (GC_suspend_all, GC_start_world): Remove
"thread_id" local variable; use THREAD_SYSTEM_ID instead of thread_id.

8 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Mon, 23 May 2016 22:34:56 +0000 (01:34 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

8 years agoRemove reference to deleted TODO file from Makefile
Ivan Maidanski [Tue, 24 May 2016 21:28:08 +0000 (00:28 +0300)]
Remove reference to deleted TODO file from Makefile
(fix commit f511a85)

* Makefile.am (EXTRA_DIST): Remove "TODO" file.
* Makefile.direct (DOC_FILES): Likewise.

8 years agoRemove (deprecate) TODO file
Ivan Maidanski [Tue, 17 May 2016 21:13:18 +0000 (00:13 +0300)]
Remove (deprecate) TODO file

ToDo/bug items are moved to "Issues" section on GitHub.

8 years agoUpdate AUTHORS file
Ivan Maidanski [Tue, 10 May 2016 20:49:29 +0000 (23:49 +0300)]
Update AUTHORS file

8 years agoSupport (add machine description for) TILE-Gx and TILEPro targets
Chris Metcalf [Tue, 10 May 2016 08:04:53 +0000 (11:04 +0300)]
Support (add machine description for) TILE-Gx and TILEPro targets

This patch is an updated version of the CentOS 6 patch that we have
been carrying as part of our own CentOS-like distribution since 2012.

* include/private/gcconfig.h (TILEGX, TILEPRO) [__tile__]: New macro.
* include/private/gcconfig.h (mach_type_known, CPP_WORDSZ, MACH_TYPE,
ALIGNMENT, ALIGN_DOUBLE, PREFETCH, CACHE_LINE_SIZE,
USE_GENERIC_PUSH_REGS, OS_TYPE, __data_start, DATASTART,
LINUX_STACKBOTTOM, DYNAMIC_LOADING, ALIGNMENT): Define for TILEGX and
TILEPRO.

8 years agoFix GC_new_kind in case of client-defined PREDEFINED_KINDS
Ivan Maidanski [Sat, 30 Apr 2016 22:07:53 +0000 (01:07 +0300)]
Fix GC_new_kind in case of client-defined PREDEFINED_KINDS

There are 2 types of kinds - "pre-allocated" ones (with the number less
than PREDEFINED_KINDS) which have pre-allocated free lists and object
allocation for these kinds is dealt by GC_malloc_kind typically,
and "custom" kinds which require the client to supply the free list
(e.g., allocated by GC_new_free_list[_inner]) and arrange own object
allocation procedure.
By design, GC_new_kind[_inner] creates new "custom" kind.

* mark.c (GC_N_KINDS_INITIAL_VALUE): Simplify and comment out (for now).
* mark.c (GC_n_kinds): Initialize to PREDEFINED_KINDS (instead of
GC_N_KINDS_INITIAL_VALUE); add TODO item.

8 years agoUpdate ChangeLog file
Ivan Maidanski [Thu, 28 Apr 2016 08:18:11 +0000 (11:18 +0300)]
Update ChangeLog file

8 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Wed, 27 Apr 2016 08:22:01 +0000 (11:22 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

8 years agoFix GC_REALLOC to call GC_FREE if new size is zero and pointer is non-NULL
Ivan Maidanski [Tue, 5 Apr 2016 19:08:55 +0000 (22:08 +0300)]
Fix GC_REALLOC to call GC_FREE if new size is zero and pointer is non-NULL

* dbg_mlc.c (GC_debug_realloc): Call GC_debug_free (and return NULL)
if lb is zero and p is non-NULL.
* extra/AmigaOS.c (GC_amiga_realloc): Do not retry and do not call
WARN if new_size_in_bytes is zero.
* include/gc.h (GC_realloc): Refine comment (better document the cases
of NULL and/or zero arguments).
* mallocx.c (GC_realloc): Call GC_free (skip it if IGNORE_FREE) and
return NULL if lb is zero and p is non-NULL.