platform/upstream/libgc.git
12 years agoUse union of AO_t and 'tse' data pointer in specific.c to avoid type
Ivan Maidanski [Sun, 29 Jan 2012 16:07:31 +0000 (20:07 +0400)]
Use union of AO_t and 'tse' data pointer in specific.c to avoid type
casting (breaking strict-aliasing rules)

* include/private/specific.h (ptse_ao_u): New union type.
* include/private/specific.h (thread_specific_data): Change type of
"hash" field from "tse" pointer to ptse_ao_u.
* specific.c (invalid_tse): Put to 'const' data section.
* specific.c (GC_key_create_inner, GC_setspecific, GC_remove_specific,
GC_slow_getspecific, GC_check_tsd_marks): Use "p" element of union to
access "tse" pointer of hash table.
* specific.c (GC_setspecific): Use "ao" element of union to store
"hash" table entry atomically; remove type cast.

12 years agoRemove part of DllMain-specific code which is always disabled (Win32)
Ivan Maidanski [Sun, 29 Jan 2012 15:15:46 +0000 (19:15 +0400)]
Remove part of DllMain-specific code which is always disabled (Win32)

* win32_threads.c (first_thread, GC_push_thread_structures): Refine
the comment.
* win32_threads.c (GC_delete_gc_thread, GC_push_thread_structures):
Remove pthread-specific code from the code specific to DllMain-based
thread registration (since GC_PTHREADS cannot be defined if
GC_NO_THREADS_DISCOVERY is undefined).
* win32_threads.c (GC_DllMain): Reformat the code.

12 years agoAdd missing 'volatile' for AO_t variable definitions
Ivan Maidanski [Sun, 29 Jan 2012 14:03:27 +0000 (18:03 +0400)]
Add missing 'volatile' for AO_t variable definitions
(to minimize number of casts breaking strict-aliasing rules)

* mallocx.c (GC_bytes_allocd_tmp): Change type from signed_word to
AO_t.
* mallocx.c (GC_generic_malloc_many): Use AO_load to get
GC_bytes_allocd_tmp value; remove type cast for GC_bytes_allocd_tmp
passed to AO_fetch_and_add.
* pthread_support.c (GC_spin_count, GC_block_count,
GC_unlocked_count): Add "volatile" for AO_t global variable (defined
only if LOCK_STATS).
* win32_threads.c (GC_attached_thread, GC_block_count,
GC_unlocked_count): Likewise.
* win32_threads.c (GC_Thread_Rep): Add "volatile" for "in_use" AO_t
field.
* win32_threads.c (GC_started_thread_while_stopped): Remove "result"
local variable; use AO_compare_and_swap_release (if available) instead
of AO_nop_full/load/store for GC_attached_thread.
* win32_threads.c (GC_stop_world): Clear GC_attached_thread using
AO_store.

12 years agoMove some GC_arrays non-pointer fields to module where they are used
Ivan Maidanski [Sun, 29 Jan 2012 10:41:46 +0000 (14:41 +0400)]
Move some GC_arrays non-pointer fields to module where they are used

* include/private/gc_priv.h (_GC_arrays): Move _max_heapsize and
_non_gc_bytes_at_gc fields to alloc.c.
* include/private/gc_priv.h (GC_max_heapsize, GC_non_gc_bytes_at_gc):
Remove.
* alloc.c (GC_non_gc_bytes_at_gc, GC_max_heapsize): Define global
variables as STATIC.

12 years agoAdjust GC_log_printf format specifiers (regarding signed/unsigned long)
Ivan Maidanski [Sat, 28 Jan 2012 18:33:58 +0000 (22:33 +0400)]
Adjust GC_log_printf format specifiers (regarding signed/unsigned long)

* alloc.c (GC_maybe_gc, GC_expand_hp_inner): Change printf "%ld"
format specifier to "%lu" one according to printed value.
* backgraph.c (GC_print_back_graph_stats): Likewise.
* blacklst.c (GC_default_print_heap_obj_proc,
GC_promote_black_lists): Likewise.
* gcj_mlc.c (GC_debug_gcj_malloc): Likewise.
* mark_rts.c (GC_print_static_roots): Likewise.
* alloc.c (GC_stopped_mark): Correct logged GC number.
* dbg_mlc.c (GC_print_backtrace): Cast printed value to proper type.
* mark.c (GC_mark_from): Likewise.
* dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page,
GC_debug_malloc_atomic_ignore_off_page, GC_debug_malloc_stubborn,
GC_debug_malloc_atomic, GC_debug_malloc_uncollectable): Change printf
"%ld" format specifier for line number to "%d" one.
* malloc.c (GC_free): Improve logged message (if LOG_ALLOCS).
* thread_local_alloc.c (GC_malloc): Likewise.
* os_dep.c (GC_dirty_init): Improve logged message (for VERBOSE level).

12 years agogctest: Output marker threads count at end
Ivan Maidanski [Sat, 28 Jan 2012 17:39:28 +0000 (21:39 +0400)]
gctest: Output marker threads count at end

* tests/test.c (run_one_test): Adjust printf format specifier.
* tests/test.c (main): Move printf for completed collections number
to check_heap_stats().
* tests/test.c (check_heap_stats): Print number of marker threads.

12 years agoMake GC_parallel a synonym to GC_markers_m1
Ivan Maidanski [Sat, 28 Jan 2012 15:28:13 +0000 (19:28 +0400)]
Make GC_parallel a synonym to GC_markers_m1

* include/gc.h (GC_parallel, GC_enable_incremental): Update comment.
* include/private/gc_priv.h (GC_markers_m1): Define as a synonym
(macro) to GC_parallel instead of declaring a global variable (only
if PARALLEL_MARKER); update the comment.
* mark.c (GC_markers_m1): Remove global variable.
* pthread_support.c (start_mark_threads): Remove unnecessary
GC_parallel zeroing (after setting GC_markers_m1 to 0).
* win32_threads.c (start_mark_threads): Likewise.
* pthread_support.c (GC_fork_child_proc, GC_thr_init): Remove
unnecessary GC_markers_m1 zeroing (after setting GC_parallel to FALSE).
* win32_threads.c (GC_thr_init): Likewise.
* pthread_support.c (GC_thr_init): Set GC_parallel to FALSE instead of
zeroing GC_markers_m1; remove GC_parallel assignment to TRUE (since
GC_markers_m1 is set to non-zero value); add the comment.
* pthread_support.c (GC_thr_init): Set GC_parallel to FALSE instead of
zeroing GC_markers_m1; add the comment.
* pthread_support.c (GC_thr_init): Remove GC_parallel assignment to
TRUE (since GC_markers_m1 is set to non-zero value).
* win32_threads.c (GC_thr_init): Likewise.

12 years agoParallel-marker code refactoring (replace GC_markers with GC_markers_m1)
Ivan Maidanski [Sat, 28 Jan 2012 13:19:25 +0000 (17:19 +0400)]
Parallel-marker code refactoring (replace GC_markers with GC_markers_m1)

* include/private/gc_priv.h (GC_markers): Replace with GC_markers_m1
(which is GC_markers minus one); update the comment.
* mark.c (GC_markers): Likewise.
* mark.c (GC_help_marker): Replace GC_markers with GC_markers_m1.
* pthread_support.c (GC_is_mach_marker, start_mark_threads,
GC_segment_is_thread_stack, GC_fork_child_proc, GC_thr_init): Likewise.
* win32_threads.c (GC_get_next_stack, start_mark_threads,
GC_wait_marker, GC_notify_all_marker, GC_thr_init): Likewise.

12 years agoChange GC_markers and GC_nprocs type to int
Ivan Maidanski [Sat, 28 Jan 2012 09:17:51 +0000 (13:17 +0400)]
Change GC_markers and GC_nprocs type to int

* include/private/gc_priv.h (GC_markers): Change type from long to int.
* mark.c (GC_markers): Likewise.
* pthread_support.c (GC_nprocs): Likewise.
* pthread_support.c (start_mark_threads, GC_thr_init): Adjust printf
format specifier for GC_markers and GC_nprocs.
* win32_threads.c (GC_thr_init): Likewise.
* pthread_support.c (GC_thr_init): Cast sysconf() result to int.
* win32_threads.c (start_mark_threads, GC_wait_marker,
GC_notify_all_marker): Remove unnecessary cast of GC_markers.
* win32_threads.c (GC_thr_init): Cast dwNumberOfProcessors to int.

12 years agoLog amount of unmapped memory (if enabled) on marking-for-collection
Ivan Maidanski [Fri, 27 Jan 2012 15:07:20 +0000 (19:07 +0400)]
Log amount of unmapped memory (if enabled) on marking-for-collection

* alloc.c (GC_stopped_mark, GC_print_heap_sects): Print
GC_unmapped_bytes value to log if USE_MUNMAP.

12 years agoCode refactoring of GC_finish_collection (eliminate code duplication
Ivan Maidanski [Fri, 27 Jan 2012 05:46:55 +0000 (09:46 +0400)]
Code refactoring of GC_finish_collection (eliminate code duplication
via COMMA_IF_USE_MUNMAP new macro)

* alloc.c (IF_USE_MUNMAP, COMMA_IF_USE_MUNMAP): New macro (defined
conditionally based on USE_MUNMAP).
* alloc.c (GC_finish_collection): Eliminate code duplication via
[COMMA_]IF_USE_MUNMAP macro.
* alloc.c (GC_try_to_collect_general): Use IF_USE_MUNMAP instead of
ifdef USE_MUNMAP.

12 years agoFix GC_init_linux_data_start to set GC_data_start to valid address
Ivan Maidanski [Fri, 27 Jan 2012 05:40:15 +0000 (09:40 +0400)]
Fix GC_init_linux_data_start to set GC_data_start to valid address
even if GC_no_dls
(fix commit db0da19)

* os_dep.c (GC_init_linux_data_start): Test GC_no_dls only to avoid
GC_find_limit call; initialize GC_data_start to DATAEND in case of
GC_no_dls to make data root empty (to prevent incorrect argument
passed to GC_add_roots_inner call in GC_register_data_segments).
* os_dep.c (GC_register_data_segments): Do not invoke
GC_add_roots_inner if upper bound (obtained from sbrk) is not upper
than DATASTART (e.g., if the latter is set to DATAEND on GC_no_dls).

12 years agoUpdate ChangeLog
Ivan Maidanski [Thu, 26 Jan 2012 17:31:37 +0000 (21:31 +0400)]
Update ChangeLog

12 years agoFix static data roots registration on Android (if GC is shared
Ivan Maidanski [Thu, 26 Jan 2012 16:36:57 +0000 (20:36 +0400)]
Fix static data roots registration on Android (if GC is shared
library) by defining GC_INIT_CONF_ROOTS

* include/gc.h (GC_INIT_CONF_ROOTS): Define to register static data
root in range from "__data_start" to "_end" on Android (unless
explicitly prohibited by client via GC_NOT_DLL macro) since the client
data root is not registered automatically if GC is build as a shared
library.
* tests/test.c (GC_COND_INIT): Invoke GC_INIT also on Android.

12 years agoFix gcconfig.h to define USE_GET_STACKBASE_FOR_MAIN for Android
Ivan Maidanski [Thu, 26 Jan 2012 05:16:10 +0000 (09:16 +0400)]
Fix gcconfig.h to define USE_GET_STACKBASE_FOR_MAIN for Android
(causing pthread_attr_getstack to be used to get main stack base
even in single-threaded mode instead of GC_linux_main_stack_base)

* include/private/gcconfig.h (USE_GET_STACKBASE_FOR_MAIN): Define if
PLATFORM_ANDROID.

12 years agoAdd debug logging on data roots addition or removal (enabled by
Ivan Maidanski [Thu, 26 Jan 2012 05:13:48 +0000 (09:13 +0400)]
Add debug logging on data roots addition or removal (enabled by
DEBUG_ADD_DEL_ROOTS new macro)

* mark_rts.c (GC_add_roots_inner): Debug logging at adding new entry
to GC_static_roots (only if DEBUG_ADD_DEL_ROOTS).
* mark_rts.c (GC_clear_roots, GC_remove_root_at_pos): Add debug
logging (only if DEBUG_ADD_DEL_ROOTS).

12 years agoAdjust OK_DISCLAIM_INITZ definition
Ivan Maidanski [Thu, 26 Jan 2012 04:44:15 +0000 (08:44 +0400)]
Adjust OK_DISCLAIM_INITZ definition

* include/private/gc_priv.h (OK_DISCLAIM_INITZ): Replace NULL with
0 for function pointer (in case of ENABLE_DISCLAIM).

12 years agoFix GC_add_roots_inner for Mac OS X (enable GC_dyld_image_add to
Daniel R. Grayson [Thu, 26 Jan 2012 04:42:33 +0000 (08:42 +0400)]
Fix GC_add_roots_inner for Mac OS X (enable GC_dyld_image_add to
pass unaligned segment start to GC_add_roots)

* mark_rts.c (GC_add_roots_inner): Round "b" pointer up to word
boundary.
* include/gc.h (GC_add_roots): Update the comment.

12 years agoRemove closure data from GC_register_disclaim_proc.
Petter Urkedal [Wed, 25 Jan 2012 19:30:02 +0000 (03:30 +0800)]
Remove closure data from GC_register_disclaim_proc.

* include/gc_disclaim.h, fnlz_mlc.c (GC_disclaim_proc, GC_register_disclaim_proc):
Remove CD from typedef and function.
* reclaim.c (GC_reclaim_uninit, GC_reclaim_block): Adjust calls.
* include/private/gc_priv.h, misc.c: Remove CD from object kind struct and
initializers.

12 years agoRemove Android-specific code inside Solaris-specific code in dyn_load
Ivan Maidanski [Wed, 25 Jan 2012 15:18:39 +0000 (19:18 +0400)]
Remove Android-specific code inside Solaris-specific code in dyn_load

* dyn_load.c (GC_register_dynamic_libraries): Remove PLATFORM_ANDROID
macro check from Solaris-specific code.

12 years agoMove GC_register_disclaim_proc to fnlz_mlc
Ivan Maidanski [Wed, 25 Jan 2012 15:12:36 +0000 (19:12 +0400)]
Move GC_register_disclaim_proc to fnlz_mlc

* misc.c (GC_register_disclaim_proc): Move definition to fnlz_mlc.c
(to minimize linked code size in case "disclaim" finalization is
unused).
* misc.c: Do not include gc_disclaim.h.
* fnlz_mlc.c (GC_register_disclaim_proc): Add GC_ASSERT for kind
passed by the client.

12 years agoCode refactoring of GC_init_real_syms (GC_USE_DLOPEN_WRAP case)
Ivan Maidanski [Wed, 25 Jan 2012 15:01:02 +0000 (19:01 +0400)]
Code refactoring of GC_init_real_syms (GC_USE_DLOPEN_WRAP case)

* pthread_support.c (GC_init_real_syms): Remove LIBPTHREAD_NAME,
LIBPTHREAD_NAME_LEN, len, namebuf, libpthread_name and simplify the
code invoking dlopen (if RTLD_NEXT not defined).

12 years agoWorkaround some Linux/arm kernels bug to get correct GC_nprocs value
Ivan Maidanski [Tue, 24 Jan 2012 15:31:53 +0000 (19:31 +0400)]
Workaround some Linux/arm kernels bug to get correct GC_nprocs value

* pthread_support.c (STAT_READ, STAT_BUF_SIZE): Move the definition
out of PLATFORM_ANDROID condition.
* pthread_support.c (GC_get_nprocs_present): New static function
obtaining number of avalable CPUs from
"/sys/devices/system/cpu/present" (only Linux/arm excluding NaCl).
* pthread_support.c (GC_thr_init): Invoke GC_get_nprocs_present
(unless set from the environment variable) to workaround a bug in
some Linux/arm kernels (including Android).

12 years agoFix GC_get_nprocs (Linux) returned variable type
Ivan Maidanski [Tue, 24 Jan 2012 04:39:47 +0000 (08:39 +0400)]
Fix GC_get_nprocs (Linux) returned variable type

* pthread_support.c (GC_get_nprocs): Change "result" local variable
type to int from word (to match returned value type); remove redundant
cast; initialize "result" variable just before its use.

12 years ago.gitignore: Add gc.log
Ivan Maidanski [Tue, 24 Jan 2012 04:23:17 +0000 (08:23 +0400)]
.gitignore: Add gc.log

12 years agoRecognize GC_LOG_TO_FILE_ALWAYS macro to log to 'gc.log' by default
Ivan Maidanski [Tue, 24 Jan 2012 04:22:01 +0000 (08:22 +0400)]
Recognize GC_LOG_TO_FILE_ALWAYS macro to log to 'gc.log' by default

* misc.c (GC_init): If "GC_LOG_FILE" environment variable is unset and
GC_LOG_TO_FILE_ALWAYS macro defined then open "gc.log" file for GC
logging (only Unix and Cygwin).

12 years agoEnable GC_MIN_MARKERS to set minimal number of pthread-based markers
Ivan Maidanski [Tue, 24 Jan 2012 04:16:14 +0000 (08:16 +0400)]
Enable GC_MIN_MARKERS to set minimal number of pthread-based markers

* pthread_support.c (GC_thr_init): Allow to specify GC_markers
minimum value (by GC_MIN_MARKERS).

12 years agoPrevent 'unused var' warnings and adjust ABORT message in GC_DllMain
Ivan Maidanski [Mon, 23 Jan 2012 18:23:39 +0000 (22:23 +0400)]
Prevent 'unused var' warnings and adjust ABORT message in GC_DllMain

* win32_threads.c (GC_DllMain): Do not declare "sb" and "sb_result"
local variables if unused.
* win32_threads (GC_DllMain): Remove redundant test for
THREAD_LOCAL_ALLOC (since it is always off if GC_NO_THREADS_DISCOVERY);
adjust ABORT message (for DLL_PROCESS_ATTACH case if PARALLEL_MARK).

12 years agoUpdate TODO file
Ivan Maidanski [Mon, 23 Jan 2012 17:48:54 +0000 (21:48 +0400)]
Update TODO file

12 years agoUpdate ChangeLog
Ivan Maidanski [Mon, 23 Jan 2012 17:26:29 +0000 (21:26 +0400)]
Update ChangeLog

12 years agoIntegrate ancient 'pcbeard' GC port for MacOS 9 Classic
Patrick C. Beard [Mon, 23 Jan 2012 17:21:48 +0000 (21:21 +0400)]
Integrate ancient 'pcbeard' GC port for MacOS 9 Classic

* include/private/gc_priv.h (bcopy, bzero, BCOPY_EXISTS): Add
definition for ancient MacOS/ppc.
* mach_dep.c (PushMacRegisters): Add implementation for MacOS/ppc.
* mach_dep.c (GC_push_regs): Fix to work on MacOS/ppc.

12 years agoRemove unused USE_GENERIC_PUSH_REGS macro (avr32)
Ivan Maidanski [Mon, 23 Jan 2012 16:58:01 +0000 (20:58 +0400)]
Remove unused USE_GENERIC_PUSH_REGS macro (avr32)

* include/private/gcconfig.h (USE_GENERIC_PUSH_REGS): Remove.

12 years agoconfigure: Enable parallel mark by default (only Linux, Solaris,
Ivan Maidanski [Mon, 23 Jan 2012 16:38:03 +0000 (20:38 +0400)]
configure: Enable parallel mark by default (only Linux, Solaris,
Darwin, Win32)

12 years agoSplit GC_abort with GC_on_abort and abort() invoked from ABORT
Ivan Maidanski [Mon, 23 Jan 2012 16:08:30 +0000 (20:08 +0400)]
Split GC_abort with GC_on_abort and abort() invoked from ABORT
(to let ABORT inherit 'noreturn' attribute of abort)

* misc.c (GC_abort): Replace with GC_on_abort (return from GC_on_abort
instead of abort); update the comment.
* include/private/gc_priv.h (GC_abort): Likewise.
* include/private/gc_priv.h (GC_on_abort): Define as empty macro in
case of SMALL_CONFIG.
* include/private/gc_priv.h (ABORT): Always call GC_on_abort (unless
PCR) and abort (or _exit, or ExitProcess or DebugBreak, depending on
the target).

12 years agoPrevent compiler warning in GC_print_callers (regarding 'pipe' variable)
Ivan Maidanski [Mon, 23 Jan 2012 15:14:15 +0000 (19:14 +0400)]
Prevent compiler warning in GC_print_callers (regarding 'pipe' variable)

* os_dep.c (GC_print_callers): Declare "pipe" local variable only if
used.

12 years agoReplace ABORTs followed by statement with ABORT_RET having dummy
Ivan Maidanski [Mon, 23 Jan 2012 04:17:19 +0000 (08:17 +0400)]
Replace ABORTs followed by statement with ABORT_RET having dummy
condition (to suppress 'statement unreachable' compiler warnings
caused by abort tagged as 'no-return')

* dbg_mlc.c (GC_debug_realloc): Replace ABORT() with ABORT_RET().
* gcj_mlc.c (mark_stack_limit): Likewise.
* os_dep.c (catch_exception_raise_state,
catch_exception_raise_state_identity): Likewise.
* typd_mlc.c (GC_descr_obj_size, GC_push_complex_descriptor): Likewise.
* include/private/gc_priv.h (ABORT_RET): New macro.
* mark.c (GC_mark_from): Put ABORT_RET instead of "cannot happen"
comment.

12 years agoTurn some unreachable return statements into reachable (to suppress
Ivan Maidanski [Mon, 23 Jan 2012 04:03:10 +0000 (08:03 +0400)]
Turn some unreachable return statements into reachable (to suppress
compiler warning)

* dbg_mlc.c (GC_generate_random_heap_address): Change function
algorithm structure to have reachable return statement at function end.
* mark.c (GC_mark_some): Likewise.
* os_dep.c (GC_mprotect_thread): Place a dummy return statement (which
uses function "arg"); remove unreachable return statement.
* win32_threads.c (GC_DllMain): Place GC_ASSERT before
GC_get_stack_base.

12 years agoAdd missing GC_ATTR_UNUSED annotation to catch_exception_raise (Darwin)
Ivan Maidanski [Mon, 23 Jan 2012 03:53:14 +0000 (07:53 +0400)]
Add missing GC_ATTR_UNUSED annotation to catch_exception_raise (Darwin)

* os_dep.c (catch_exception_raise_state,
catch_exception_raise_state_identity, catch_exception_raise): Tag
unused arguments with GC_ATTR_UNUSED.

12 years agoFix a typo in a comment in os_dep.c
Ivan Maidanski [Mon, 23 Jan 2012 03:48:48 +0000 (07:48 +0400)]
Fix a typo in a comment in os_dep.c

* os_dep.c (GC_sigbus_count): Fix a typo in a comment.

12 years agoUpdate TODO file
Ivan Maidanski [Fri, 20 Jan 2012 22:15:54 +0000 (02:15 +0400)]
Update TODO file

12 years agoUpdate ChangeLog
Ivan Maidanski [Fri, 20 Jan 2012 22:14:36 +0000 (02:14 +0400)]
Update ChangeLog

12 years agoalloc: tune the code to collect instead of expanding the heap if
Paolo Molaro [Wed, 16 Feb 2005 21:23:39 +0000 (21:23 +0000)]
alloc: tune the code to collect instead of expanding the heap if
there are many finalizers and we reclaimed some memory from cleaning
the finalization queue (should fix Mono bugs #71001 and #70701).
(Apply commit a43aba7 from 'mono_libgc' branch)

* alloc.c (last_fo_entries, last_bytes_finalized): New static
variable.
* alloc.c (GC_collect_or_expand): Test GC_fo_entries delta (in case
of non-zero GC_bytes_finalized value) in the condition of toggling
garabage collection; update last_fo_entries and last_bytes_finalized
values.
* include/private/gc_priv.h (GC_fo_entries): Declare global variable
(for use in GC_collect_or_expand).

12 years agoUpdate bug reports email address (recommend GC mailing list)
Ivan Maidanski [Fri, 20 Jan 2012 18:29:49 +0000 (22:29 +0400)]
Update bug reports email address (recommend GC mailing list)

* configure.ac (AC_INIT): Update bug reports email.
* doc/gcdescr.html: Likewise.
* doc/overview.html: Fix email address.

12 years agocordprnt: Suppress 'uninitialized variable use' compiler warning
Ivan Maidanski [Thu, 19 Jan 2012 04:41:17 +0000 (08:41 +0400)]
cordprnt: Suppress 'uninitialized variable use' compiler warning

* cord/cordprnt.c (CORD_fprintf, CORD_vfprintf, CORD_printf,
CORD_vprintf): Initialize "out" local variable to prevent
"uninitialized variable use" compiler warning.

12 years agocordtest: Add a test for CORD_cat
Ivan Maidanski [Thu, 19 Jan 2012 04:39:14 +0000 (08:39 +0400)]
cordtest: Add a test for CORD_cat

* cord/tests/cordtest.c (test_basics): Insert a check of CORD_cat
result to be not CORD_EMPTY (in case of a non-empty input).

12 years agoFix GC_finalized_malloc for out-of-memory case (and for missing
Ivan Maidanski [Wed, 18 Jan 2012 04:51:16 +0000 (08:51 +0400)]
Fix GC_finalized_malloc for out-of-memory case (and for missing
'const' qualifier)

* fnlz_mlc.c (GC_finalized_disclaim): Add 'const' qualifier for "fc"
pointer.
* fnlz_mlc.c (GC_core_finalized_malloc, GC_finalized_malloc): Cast
"op" to 'const' pointer on "fclos" storing.
* fnlz_mlc.c (GC_finalized_malloc): Use GC_get_oom_fn() instead of
locked read of GC_oom_fn.
* fnlz_mlc.c (GC_core_finalized_malloc): Test GC_generic_malloc result
for NULL (return NULL in this case).
* fnlz_mlc.c (GC_core_finalized_malloc): Add assertion on GC_size
returned value (at least just to outline that it might be bigger than
"lb" value).

12 years agoImprove disclaim_bench and disclaim_test
Ivan Maidanski [Wed, 18 Jan 2012 04:44:11 +0000 (08:44 +0400)]
Improve disclaim_bench and disclaim_test

* tests/disclaim_bench.c: Do not include assert.h.
* tests/disclaim_test.c: Likewise.
* tests/disclaim_bench.c (my_assert): New macro.
* tests/disclaim_test.c: Likewise.
* tests/disclaim_bench.c (testobj_finalize, testobj_new): Replace
assert with my_assert.
* tests/disclaim_test.c (misc_sizes_dct, test_misc_sizes, pair_dct,
pair_new, pair_check_rec): Likewise.
* tests/disclaim_test.c (misc_sizes_dct): Test "cd" value (at least to
prevent "unused argument" compiler warning).
* tests/disclaim_test.c (test_misc_sizes): Use ANSI C style of
function declaration.
* tests/disclaim_bench.c (fclos): Add 'const' qualifier (since
GC_finalized_malloc now accepts const pointer).
* tests/disclaim_test.c (test_misc_sizes, pair_new): Likewise.
* tests/disclaim_test.c (test_misc_sizes, pair_new): Test
GC_finalized_malloc result for NULL.

12 years agoFix realloc_test to check GC_malloc result for NULL
Ivan Maidanski [Wed, 18 Jan 2012 04:39:17 +0000 (08:39 +0400)]
Fix realloc_test to check GC_malloc result for NULL

* tests/realloc_test.c (main): Prevent NULL pointer dereference
(exit with an error message in case of NULL returned by GC_malloc).

12 years agoUse EXPECT in malloc result testing for NULL
Ivan Maidanski [Wed, 18 Jan 2012 04:36:33 +0000 (08:36 +0400)]
Use EXPECT in malloc result testing for NULL

* gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Use EXPECT to test "op"
value for NULL.
* malloc.c (GC_generic_malloc_inner, GC_malloc_uncollectable):
Likewise.
* mallocx.c (GC_generic_malloc_many, GC_posix_memalign): Likewise.
* typd_mlc.c (GC_malloc_explicitly_typed,
GC_malloc_explicitly_typed_ignore_off_page,
GC_calloc_explicitly_typed): Likewise.

12 years agoMove finalizer closure to the end of objects.
Petter Urkedal [Mon, 16 Jan 2012 20:51:35 +0000 (04:51 +0800)]
Move finalizer closure to the end of objects.

* fnlz_mlc.c: Move finalizer closure for finalized object kinds to the end
of objects.  This way, we don't require all interior pointers, and GC_base
returns the expected address.
* tests/disclaim_test.c: Improve test coverage.

12 years agoAdd 'const' qualifier to pointer argument of GC_clear/set_mark_bit,
Ivan Maidanski [Tue, 17 Jan 2012 15:44:39 +0000 (19:44 +0400)]
Add 'const' qualifier to pointer argument of GC_clear/set_mark_bit,
GC_finalized_malloc, GC_general_register_disappearing_link

* dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change):
Make argument pointer const.
* finalize.c (GC_general_register_disappearing_link): Likewise.
* fnlz_mlc.c (GC_core_finalized_malloc, GC_finalized_malloc): Likewise.
* include/gc.h (GC_change_stubborn, GC_end_stubborn_change,
GC_debug_change_stubborn, GC_debug_end_stubborn_change,
GC_general_register_disappearing_link): Likewise.
* include/gc_disclaim.h (GC_finalized_malloc): Likewise.
* include/gc_mark.h (GC_clear_mark_bit, GC_set_mark_bit): Likewise.
* mark.c (GC_set_mark_bit, GC_clear_mark_bit): Likewise.
* stubborn.c (GC_end_stubborn_change, GC_change_stubborn): Likewise.
* finalize.c (GC_general_register_disappearing_link): Remove redundant
pointer type casts.
* tests/test.c (cons, print_int_list, mktree): Likewise.
* include/gc.h (GC_GENERAL_REGISTER_DISAPPEARING_LINK): Add cast
removing potential 'const' qualifier.

12 years agoFix cordtest temporary file names for Win32
Ivan Maidanski [Tue, 17 Jan 2012 04:19:04 +0000 (08:19 +0400)]
Fix cordtest temporary file names for Win32

* cord/tests/cordtest.c (FNAME1, FNAME2): Do not specify folder
(platform-dependent) for temporary file; use same short file name
(DOS-compatible) for all targets.

12 years agoUpdate ChangeLog
Ivan Maidanski [Tue, 17 Jan 2012 04:02:00 +0000 (08:02 +0400)]
Update ChangeLog

12 years agoMove cord_pos.h to public headers folder (since included from cord.h)
Ivan Maidanski [Mon, 16 Jan 2012 05:24:57 +0000 (09:24 +0400)]
Move cord_pos.h to public headers folder (since included from cord.h)

* include/private/cord_pos.h: Rename to include/cord_pos.h.
* BCC_MAKEFILE (de_win.obj): Rename "private/cord_pos.h" entry to
"cord_pos.h".
* Makefile.direct (CORD_SRCS, CORD_INCLUDE_FILES): Likewise.
* Makefile.dj (CORD_SRCS, CORD_INCLUDE_FILES): Likewise.
* NT_MAKEFILE (de_win.obj): Likewise.
* NT_STATIC_THREADS_MAKEFILE (de_win.obj): Likewise.
* NT_X64_STATIC_THREADS_MAKEFILE (de_win.obj): Likewise.
* NT_X64_THREADS_MAKEFILE (de_win.obj): Likewise.
* OS2_MAKEFILE (cordbscs.obj, cordxtra.obj, cordprnt.obj,
cordtest.exe): Likewise.
* gc.mak (DEP_CPP_DE_WI, DEP_CPP_DE_C2e, DEP_CPP_CORDX,
DEP_CPP_CORDB): Likewise.
* include/include.am (dist_noinst_HEADERS): Likewise.
* include/cord.h: Include "private/cord_pos.h" instead of "cord_pos.h".
* include/cord_pos.h (CORD_H): Test (skip the file if undefined).
* include/cord_pos.h (CORD_POSITION_H): Define.

12 years agoMerge branch 'libcord-visibility'
Ivan Maidanski [Mon, 16 Jan 2012 12:03:34 +0000 (16:03 +0400)]
Merge branch 'libcord-visibility'

12 years agoconfigure: improve GCC '-fvisibility' option support checking
Ivan Maidanski [Mon, 16 Jan 2012 05:13:23 +0000 (09:13 +0400)]
configure: improve GCC '-fvisibility' option support checking

* configure.ac (GC_DLL): Add "-Werror" to CFLAGS (to treat warnings
as errors) when checking for "-fvisibility=hidden" support (useful for
Cygwin).

12 years agoRemove dependency on cord in gc_config_macros.h (libcord visibility fix)
Ivan Maidanski [Mon, 16 Jan 2012 04:55:33 +0000 (08:55 +0400)]
Remove dependency on cord in gc_config_macros.h (libcord visibility fix)

* include/cord.h: Do not include gc_config_macros.h.
* include/cord.h (CORD_API): Define similar to GC_API definition in
gc_config_macros.h.
* include/gc_config_macros.h: Revert changes done in
"libcord visibility fix" (do not test CORD_H, do not define
GC_API_EXPORT and GC_API_IMPORT).

12 years agoMinor adjustment of libcord visibility fix
Ivan Maidanski [Mon, 16 Jan 2012 04:42:33 +0000 (08:42 +0400)]
Minor adjustment of libcord visibility fix

* cord/cord.am (libcord_la_CPPFLAGS): Do not define CORD_BUILD and
GC_DLL here (same approach as for GC_BUILD).
* cord/cordbscs.c: Include config.h if HAVE_CONFIG_H (for GC_DLL) and
define CORD_BUILD (before including cord.h).
* cord/cordprnt.c: Likewise.
* cord/cordxtra.c: Likewise.

12 years agoFix visibility of symbols in libcord.
Petter Urkedal [Sat, 14 Jan 2012 10:11:12 +0000 (11:11 +0100)]
Fix visibility of symbols in libcord.

* include/gc_config_macros.h: Make the export specifications usable also to
the cord library.
* include/cord.h, include/private/cord_pos.h: Define CORD_API and annotate
the public API.

12 years agoAdd 'const' qualifier for GC_is_marked argument pointer
Ivan Maidanski [Fri, 13 Jan 2012 16:30:23 +0000 (20:30 +0400)]
Add 'const' qualifier for GC_is_marked argument pointer

* include/gc_mark.h (GC_is_marked): Refine comment.
* include/gc_mark.h (GC_is_marked): Make passed pointer const.
* mark.c (GC_is_marked): Likewise.
* mark.c (GC_is_marked): Cast result to int (instead of GC_bool).

12 years agoExport mark-bit manipulation functions.
Petter Urkedal [Sun, 8 Jan 2012 09:30:42 +0000 (17:30 +0800)]
Export mark-bit manipulation functions.

* include/private/gc_priv.h, include/gc_mark.h: Move GC_is_marked,
GC_clear_mark_bit and GC_set_mark_bit to a public header and adjust
prototypes and comment.
* mark.c: Adjust prototypes accordingly.

12 years agoFix extra/gc.c to enable GC source inclusion from multi-threaded app
Ivan Maidanski [Fri, 13 Jan 2012 15:53:47 +0000 (19:53 +0400)]
Fix extra/gc.c to enable GC source inclusion from multi-threaded app

* extra/gc.c: Include gc_pthread_redirects.h (unless
GC_NO_THREAD_REDIRECTS) to restore thread calls macro-based
redirection after the corresponding undef's in pthread_support.c.
* win32_threads.c: Restore thread calls macro-based redirection
(unless GC_NO_THREAD_REDIRECTS) at the file end.
* extra/gc.c: Remove "file not well tested" comment.

12 years agoAdd setter and getter for GC_on_heap_resize;
Ivan Maidanski [Fri, 13 Jan 2012 04:55:21 +0000 (08:55 +0400)]
Add setter and getter for GC_on_heap_resize;
change GC_on_heap_resize argument type from size_t to GC_word

* include/gc.h (GC_on_heap_resize_proc): Declare new type.
* alloc.c (GC_on_heap_resize): Change type to GC_on_heap_resize_proc
(which uses GC_word argument instead of size_t and GC_CALLBACK calling
conventions).
* include/gc.h (GC_on_heap_resize): Likewise.
* alloc.c (GC_expand_hp_inner): Do not cast GC_heapsize value in
GC_on_heap_resize call.
* include/gc.h (GC_on_heap_resize): Refine comment.
* include/gc.h (GC_set_on_heap_resize, GC_get_on_heap_resize): New
API functions.
* misc.c (GC_set_on_heap_resize, GC_get_on_heap_resize): Likewise.

12 years agoAdd on-heap-resize event notification to API
Paolo Molaro [Mon, 24 Jan 2005 15:29:23 +0000 (15:29 +0000)]
Add on-heap-resize event notification to API
(Apply part of commit 3f1314a from 'mono_libgc' branch)

* include/gc.h (GC_on_heap_resize): New API variable declaration.
* alloc.c (GC_on_heap_resize): New global variable.
* alloc.c (GC_finish_collection): Invoke GC_on_heap_resize (if
non-zero) on returning true.

12 years agoUpdate AUTHORS file
Ivan Maidanski [Thu, 12 Jan 2012 04:39:37 +0000 (08:39 +0400)]
Update AUTHORS file

12 years agoReplace repeating '==' sequences in documentation with double '=' mark
Ivan Maidanski [Thu, 12 Jan 2012 03:51:16 +0000 (07:51 +0400)]
Replace repeating '==' sequences in documentation with double '=' mark

* TODO: Replace sequences of repeating '==' identifying section
titles (which is also used by git-apply) with two '=' symbols at the
beginning and at the end of each title.
* ChangeLog: Likewise.
* doc/README.Mac: Likewise.
* doc/README.darwin: Likewise.
* configure.ac: Remove sequences of repeating '==' (in a comment).
* doc/README.amiga: Likewise.

12 years agoUpdate TODO file
Ivan Maidanski [Thu, 12 Jan 2012 03:37:15 +0000 (07:37 +0400)]
Update TODO file

12 years ago.gitignore: Ignore *.gc.log files
Ivan Maidanski [Thu, 12 Jan 2012 03:29:56 +0000 (07:29 +0400)]
.gitignore: Ignore *.gc.log files

12 years agoImprove GC_thread_is_registered implementation and testing
Ivan Maidanski [Thu, 12 Jan 2012 03:25:56 +0000 (07:25 +0400)]
Improve GC_thread_is_registered implementation and testing

* pthread_support.c (GC_thread_is_registered): Call pthread_self
outside LOCK; add DCL_LOCK_STATE declaration; replace "ptr" local
variable with "GC_thread me" (and remove cast).
* win32_threads.c (GC_thread_is_registered): Fix implementation by
calling GC_lookup_thread_inner (now works the same as in
pthread_support.c).
* tests/test.c (run_one_test): Test GC_thread_is_registered (only if
THREADS).

12 years agoAdd GC_thread_is_registered API function
Zoltan Varga [Thu, 3 Mar 2005 21:09:34 +0000 (21:09 +0000)]
Add GC_thread_is_registered API function
(Apply commit 9b40e5d from 'mono_libgc' branch)

* include/gc.h (GC_thread_is_registered): Declare new API function
(only if GC_THREADS).
* pthread_support.c (GC_thread_is_registered): New API function
implementation.
* win32_threads.c (GC_thread_is_registered): Likewise.

12 years agoOptimization: move pthread_self calls out of LOCK section
Ivan Maidanski [Tue, 10 Jan 2012 18:03:20 +0000 (22:03 +0400)]
Optimization: move pthread_self calls out of LOCK section

* pthread_support.c (GC_do_blocking_inner, GC_call_with_gc_active,
pthread_exit): Move pthread_self call out of LOCK section (declare
"self" local variable).
* win32_threads.c (GC_call_with_gc_active): Move GetCurrentThreadId
call out of LOCK section (declare "thread_id" local variable).

12 years agoFix GC_restart_handler to preserve errno if needed
Ivan Maidanski [Tue, 10 Jan 2012 17:00:59 +0000 (21:00 +0400)]
Fix GC_restart_handler to preserve errno if needed

* pthread_stop_world.c (GC_restart_handler): Preserve errno value in
case of sem_post or GC_log_printf invocation inside.

12 years agoEliminate code in GC_suspend_handler
Ivan Maidanski [Tue, 10 Jan 2012 16:33:57 +0000 (20:33 +0400)]
Eliminate code in GC_suspend_handler

* pthread_stop_world.c (GC_suspend_handler): Eliminate code
duplication (regarding errno save/restore).

12 years agoAdd assertion on result alignment to GC_unix_mmap_get_mem
Zoltan Varga [Tue, 23 May 2006 15:23:37 +0000 (15:23 +0000)]
Add assertion on result alignment to GC_unix_mmap_get_mem
(Apply commit 3e56070 from 'mono_libgc' branch)

* os_dep.c (GC_unix_mmap_get_mem): Add an assert to bail out early if
run on a machine with smaller page size than HBLKSIZE.

12 years agoFreeBSD: Add comment to SIG_SUSPEND/THR_RESTART definitions
Ivan Maidanski [Tue, 10 Jan 2012 13:18:10 +0000 (17:18 +0400)]
FreeBSD: Add comment to SIG_SUSPEND/THR_RESTART definitions

* include/private/gcconfig.h (SIG_SUSPEND, SIG_THR_RESTART): Add
comment (suggest alternate value) for FreeBSD/i386, FreeBSD/alpha and
FreeBSD/x86_64.

12 years agoAvoid unnecessary GC_find_limit invocation if GC_no_dls
Zoltan Varga [Mon, 23 Feb 2009 21:26:49 +0000 (21:26 +0000)]
Avoid unnecessary GC_find_limit invocation if GC_no_dls
(Apply commit f5d47a1 from 'mono_libgc' branch)

* os_dep.c (GC_init_linux_data_start): Avoid the call to
GC_find_limit() if GC_no_dls is TRUE, as it is not needed and
it complicates debugging since it causes a SIGSEGV.
* os_dep.c (GC_register_data_segments): Add assertion for DATASTART.

12 years agoAdd 'const' qualifier for GC_make_descriptor bitmap argument
Ivan Maidanski [Tue, 10 Jan 2012 10:16:26 +0000 (14:16 +0400)]
Add 'const' qualifier for GC_make_descriptor bitmap argument

* include/gc_typed.h (GC_make_descriptor): Make bm pointer const
(replace GC_bitmap type with "const GC_word*").
* typd_mlc.c (GC_add_ext_descriptor, GC_make_descriptor): Likewise.
* tests/test.c (bm_huge): Make array const to test updated
GC_make_descriptor declaration.

12 years agoEnable platform-specific disabling of static data scanning
Ivan Maidanski [Tue, 10 Jan 2012 09:58:14 +0000 (13:58 +0400)]
Enable platform-specific disabling of static data scanning
(Reworked commit a0347f0 from 'mono_libgc' branch)

* include/private/gcconfig.h (GC_DONT_REGISTER_MAIN_STATIC_DATA):
Recognize new macro.
* include/private/gcconfig.h (DYNAMIC_LOADING): Do not define for
Darwin/arm if GC_DONT_REGISTER_MAIN_STATIC_DATA.
* misc.c (GC_REGISTER_MAIN_STATIC_DATA): Define to FALSE if
GC_DONT_REGISTER_MAIN_STATIC_DATA (and not DYNAMIC_LOADING).

12 years agoWin32: allow DllMain chaining on the client side
Ivan Maidanski [Tue, 10 Jan 2012 06:27:33 +0000 (10:27 +0400)]
Win32: allow DllMain chaining on the client side
(Reworked commits e55eb9c, 34a996f from 'mono_libgc' branch)

* configure.ac (enable_win32_dllmain): Recognize new AC "enable"
option.
* configure.ac (GC_INSIDE_DLL): New AC macro (defined only if
enable_win32_dllmain).
* README.macros (GC_INSIDE_DLL): Document.
* include/gc.h (GC_DllMain): Declare as API function (for Win32) if
GC_INSIDE_DLL.
* win32_threads.c (GC_INSIDE_DLL): Recognize (treat the same as
GC_DLL).
* win32_threads.c (DllMain): Rename to GC_DllMain; use GC_API export
declarator if GC_INSIDE_DLL, otherwise define GC_DllMain macro as
a synonym to DllMain.

12 years agoUpdate ChangeLog
Ivan Maidanski [Fri, 30 Dec 2011 10:56:35 +0000 (14:56 +0400)]
Update ChangeLog

12 years agoUpdate TODO file
Ivan Maidanski [Fri, 30 Dec 2011 09:44:04 +0000 (13:44 +0400)]
Update TODO file

12 years agoMerge branch 'thread-dbg-msg-extend'
Ivan Maidanski [Thu, 29 Dec 2011 14:50:57 +0000 (18:50 +0400)]
Merge branch 'thread-dbg-msg-extend'

12 years agoReplace printf PRIxMAX specifier with '%p' for thread id debug output
Ivan Maidanski [Thu, 29 Dec 2011 14:46:53 +0000 (18:46 +0400)]
Replace printf PRIxMAX specifier with '%p' for thread id debug output

* pthread_support.c (GC_new_thread, GC_delete_thread,
GC_delete_gc_thread, GC_unregister_my_thread_inner,
GC_unregister_my_thread, GC_thread_exit_proc,
GC_start_rtn_prepare_thread, pthread_create): Output thread id value
(when DEBUG_THREADS) using %p format specifier instead of PRIxMAX, %x
and %lx (casting passed id value to pointer type instead of uintmax_t).
* pthread_start.c (GC_inner_start_routine): Likewise.
GC_stop_world, GC_thread_resume, GC_start_world): Likewise.
* pthread_stop_world.c (GC_suspend_handler_inner, GC_restart_handler,
GC_push_all_stacks, GC_suspend_all, GC_stop_world, GC_start_world):
Likewise.
* darwin_stop_world.c (GC_stack_range_for, GC_suspend_thread_list,
* pthread_start.c: Do not include inttypes.h.
* pthread_support.c: Likewise.
* pthread_support.c (GC_count_threads): Define only if DEBUG_THREADS.
* pthread_support.c (GC_unregister_my_thread): Rename gc_self local
variable to "me".
* pthread_support.c (pthread_create): Report thread started (when
DEBUG_THREADS) only if result is 0.

12 years agoAdd GC_is_heap_ptr() to GC API
Ivan Maidanski [Thu, 29 Dec 2011 12:12:37 +0000 (16:12 +0400)]
Add GC_is_heap_ptr() to GC API

* include/gc.h (GC_is_heap_ptr): New API function declaration.
* misc.c (GC_is_heap_ptr): New function.
* tests/test.c (run_one_test): Add GC_is_heap_ptr tests.

12 years agoUse EXPECT for checking various 'initialized' boolean variables
Ivan Maidanski [Thu, 29 Dec 2011 10:04:58 +0000 (14:04 +0400)]
Use EXPECT for checking various 'initialized' boolean variables

* alloc.c (GC_try_to_collect_general, GC_expand_hp): Use "expect true"
for GC_is_initialized value.
* gcj_mlc.c (maybe_finalize): Likewise.
* malloc.c (GC_alloc_large, GC_generic_malloc_inner, malloc): Likewise.
* mallocx.c (GC_generic_malloc_many): Likewise.
* mark_rts.c (GC_add_roots, GC_clear_roots): Likewise.
* misc.c (GC_base, GC_init): Likewise.
* ptr_chck.c (GC_same_obj, GC_is_valid_displacement, GC_is_visible):
Likewise.
* darwin_stop_world.c (GC_push_all_stacks): Use "expect true"
for GC_thr_initialized value.
* pthread_stop_world.c (GC_push_all_stacks): Likewise.
* pthread_support.c (pthread_create): Likewise.
* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Use
"expect true" for excluded_segs value.
* include/private/gc_priv.h (COND_DUMP): Use "expect false"
for GC_dump_regularly value.
* malloc.c (GC_generic_malloc): Use "expect false" for GC_have_errors
value.
* mallocx.c (GC_generic_malloc_ignore_off_page,
GC_generic_malloc_many): Likewise.
* malloc.c (calloc): Use "expect true" for lib_bounds_set value.
* os_dep.c (GC_unix_mmap_get_mem): Use "expect true" for "initialized"
value.
* pthread_stop_world.c (GC_nacl_initialize_gc_thread): Use
"expect true" for GC_nacl_thread_parking_inited value.
* pthread_support.c (INIT_REAL_SYMS): Use "expect true" for
GC_syms_initialized value; remove redundant trailing ';'.
* pthread_support.c (GC_new_thread):  Use "expect true" for
first_thread_used value.
* win32_threads.c (GC_new_thread): Likewise.
* pthread_support.c (pthread_create): Use "expect true" for
parallel_initialized value.
* win32_threads.c (GC_CreateThread, GC_beginthreadex,
GC_pthread_join, GC_pthread_create, GC_pthread_sigmask,
GC_pthread_detach): Likewise.
* pthread_support.c (pthread_create): Use "expect false" for "si"
value to be NULL.
* thread_local_alloc.c (GC_init_thread_local): Use "expect true" for
keys_initialized value.
* typd_mlc.c (GC_make_descriptor): Use "expect true" for
GC_explicit_typing_initialized value.

12 years agoRefactoring: rename GC_EXPECT to EXPECT in .c files
Ivan Maidanski [Thu, 29 Dec 2011 08:37:01 +0000 (12:37 +0400)]
Refactoring: rename GC_EXPECT to EXPECT in .c files

* fnlz_mlc.c (GC_core_finalized_malloc, GC_finalized_malloc):
Rename GC_EXPECT to EXPECT; replace 0/1 with TRUE/FALSE for the 2nd
argument of EXPECT.
* thread_local_alloc.c (GC_gcj_malloc): Likewise.

12 years agoPrevent compiler warning in cordtest
Ivan Maidanski [Thu, 29 Dec 2011 08:16:05 +0000 (12:16 +0400)]
Prevent compiler warning in cordtest

* cord/tests/cordtest.c (id_cord_fn): Test client_data (at least to
prevent "unused argument" compiler warning).

12 years agoFix GC_ASSERT usage (fix missing trailing semi-colon)
Ivan Maidanski [Thu, 29 Dec 2011 06:38:09 +0000 (10:38 +0400)]
Fix GC_ASSERT usage (fix missing trailing semi-colon)

* misc.c (GC_init): Append ';' after GC_ASSERT().
* os_dep.c (GC_protect_heap): Likewise.

12 years agoRefactoring: rename GC_PRIdPTR to WARN_PRIdPTR
Ivan Maidanski [Thu, 29 Dec 2011 06:07:14 +0000 (10:07 +0400)]
Refactoring: rename GC_PRIdPTR to WARN_PRIdPTR

* allchblk.c (GC_allochblk_nth): Rename GC_PRIdPTR to WARN_PRIdPTR.
* alloc.c (GC_collect_or_expand): Likewise.
* include/private/gc_priv.h (GC_PRIdPTR): Likewise.
* pthread_support.c (start_mark_threads, GC_thr_init): Likewise.
* GC_thr_init (GC_delete_thread): Likewise.
* include/private/gc_priv.h (WARN): Add comment about argument format
specifier.
* include/private/gc_priv.h (GC_PRIdPTR): Remove commented out code;
refine comment.

12 years agoRemove dead rule for test_dll in Makefile.direct
Ivan Maidanski [Wed, 28 Dec 2011 13:04:05 +0000 (17:04 +0400)]
Remove dead rule for test_dll in Makefile.direct

* Makefile.direct (test_dll.o, test_dll): Remove obsolete rule
(that uses missing libgc_globals.h).
* Makefile.dj (test_dll.o, test_dll): Likewise.

12 years agoEMX_MAKEFILE: Remove GC general tuning macros description
Ivan Maidanski [Wed, 28 Dec 2011 12:56:22 +0000 (16:56 +0400)]
EMX_MAKEFILE: Remove GC general tuning macros description

12 years agoUpdate TODO file
Ivan Maidanski [Wed, 28 Dec 2011 12:37:31 +0000 (16:37 +0400)]
Update TODO file

12 years agoAdd cordtest to make check
Ivan Maidanski [Wed, 28 Dec 2011 12:35:53 +0000 (16:35 +0400)]
Add cordtest to make check

* cord/cord.am (TESTS, check_PROGRAMS): Add cordtest entry.
* cord/cord.am (cordtest_SOURCES, cordtest_LDADD): New AM variable.
* cord/cord.am (EXTRA_DIST): Remove cordtest.c entry.

12 years agoRemove unused __STDC__ and NO_SIGNALS macros
Ivan Maidanski [Wed, 28 Dec 2011 11:59:55 +0000 (15:59 +0400)]
Remove unused __STDC__ and NO_SIGNALS macros

* BCC_MAKEFILE (cflags): Remove -D __STDC__.
* digimars.mak (DEFINES): Likewise.
* Mac_files/MacOS_config.h (__STDC__, NO_SIGNALS): Remove macro.
* doc/README.Mac (__STDC__, NO_SIGNALS): Likewise.
* windows-untested/stdafx.h (__STDC__): Likewise.
* README: Remove obsolete information about NO_SIGNALS.

12 years agoRemove unused SILENT macro; remove duplicate MacOS_Test_config.h file
Ivan Maidanski [Wed, 28 Dec 2011 11:44:21 +0000 (15:44 +0400)]
Remove unused SILENT macro; remove duplicate MacOS_Test_config.h file

* Mac_files/MacOS_Test_config.h: Remove.
* Mac_files/MacOS_config.h: Expand tabs to spaces.
* Mac_files/MacOS_config.h (SILENT): Remove unused macro.
* windows-untested/stdafx.h (SILENT): Likewise.
* Mac_files/MacOS_config.h: Remove GC tuning macros description.
* Makefile.am (EXTRA_DIST): Remove MacOS_Test_config.h entry.
* Makefile.direct (OTHER_FILES): Likewise.
* Makefile.dj (OTHER_FILES): Likewise.
* doc/README.Mac: Update (remove info about MacOS_Test_config.h and
SILENT macro).

12 years agoconfigure: Do not install ancient new_gc_alloc.h broken for modern STL
Ivan Maidanski [Wed, 28 Dec 2011 11:05:52 +0000 (15:05 +0400)]
configure: Do not install ancient new_gc_alloc.h broken for modern STL

* include/include.am (pkginclude_HEADERS): Move new_gc_alloc.h entry
to dist_noinst_HEADERS.

12 years agoFix configure --enable-cplusplus make install
Ivan Maidanski [Wed, 28 Dec 2011 10:55:57 +0000 (14:55 +0400)]
Fix configure --enable-cplusplus make install

* Makefile.am (pkginclude_HEADERS): Remove gc_allocator.h
entry.
* Makefile.am (include_HEADERS): Add include/extra/gc_cpp.h entry
(only if CPLUSPLUS).
* include/include.am (pkginclude_HEADERS): Remove include/gc_cpp.h
entry.
* include/include.am (include_HEADERS): Remove include/extra/gc_cpp.h
entry.

12 years agotest_cpp: Recognize new macro to choose between GC allocator headers
Ivan Maidanski [Wed, 28 Dec 2011 10:19:28 +0000 (14:19 +0400)]
test_cpp: Recognize new macro to choose between GC allocator headers

* tests/test_cpp.cc (USE_STD_ALLOCATOR): Replace with
DONT_USE_STD_ALLOCATOR; remove explicit macro definition; add comment.
* tests/test_cpp.cc (main): Use DONT_USE_STD_ALLOCATOR macro instead
of USE_STD_ALLOCATOR.

12 years agoFix GC_printf import declarator in test_cpp.cc
Ivan Maidanski [Wed, 28 Dec 2011 08:44:06 +0000 (12:44 +0400)]
Fix GC_printf import declarator in test_cpp.cc

* tests/test_cpp.cc (GC_API_PRIV): New macro (same definition as in
gc_priv.h).
* tests/test_cpp.cc (GC_printf): Use GC_API_PRIV instead of GC_API.

12 years agoconfigure: ensure alphabetic order of files listed in include.am
Ivan Maidanski [Wed, 28 Dec 2011 08:30:45 +0000 (12:30 +0400)]
configure: ensure alphabetic order of files listed in include.am

* include/include.am (pkginclude_HEADERS, dist_noinst_HEADERS): Sort
entries lexicographically.