platform/upstream/libgc.git
13 years ago2009-10-18 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 18 Oct 2009 08:46:08 +0000 (08:46 +0000)]
2009-10-18  Ivan Maidanski <ivmai@mail.ru>

* backgraph.c (GC_quiet): Remove the declaration (not needed
anymore since gc_priv.h is always included).
* checksums.c (GC_quiet): Ditto.
* gcj_mlc.c (GC_quiet): Ditto.
* headers.c (GC_hdr_cache_hits, GC_hdr_cache_misses): Add the
comment.
* include/private/gc_hdrs.h (GC_hdr_cache_hits,
GC_hdr_cache_misses): Ditto.
* mark.c (GC_first_nonempty): Make the volatile variable STATIC.
* pthread_stop_world.c (GC_stop_count, GC_world_is_stopped):
Ditto.
* win32_threads.c (GC_please_stop, GC_max_thread_index,
GC_mark_mutex_waitcnt): Ditto.

13 years ago2009-10-18 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 18 Oct 2009 05:21:39 +0000 (05:21 +0000)]
2009-10-18  Ivan Maidanski <ivmai@mail.ru>

* pthread_support.c (GC_USE_LD_WRAP): Fix a typo (swapped 'L' and
'D') in the name.

13 years ago2009-10-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 17 Oct 2009 21:54:30 +0000 (21:54 +0000)]
2009-10-17  Ivan Maidanski <ivmai@mail.ru>

* gc_dlopen.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Define if dlopen
redirection is turned off; turn it on later when dlopen real
symbol is no longer needed (according to the comment and the same
as in dyn_load.c).
* gc_dlopen.c (WRAP_FUNC, REAL_FUNC): Rename to WRAP_DLFUNC and
REAL_DLFUNC, respectively (to have unique names since the
definitions may differ from that of the similar ones in
pthread_support.c).
* mark.c (source): Undefine the macro when no longer needed.
* os_dep.c (handler): Rename the type to GC_fault_handler_t (to
have the unique name across the project).
* os_dep.c (STAT_BUF_SIZE, STAT_READ); Guard with ifndef; add the
comment.
* pthread_support.c (STAT_BUF_SIZE, STAT_READ): Ditto.
* os_dep.c (sbrk): Undo sbrk() redirection (for ECOS) when no
longer needed.

13 years ago2009-10-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 17 Oct 2009 21:22:12 +0000 (21:22 +0000)]
2009-10-17  Ivan Maidanski <ivmai@mail.ru>

* pthread_stop_world.c (pthread_sigmask): Undefine before using
in GC_print_sig_mask() (only if DEBUG_THREADS); add the comment.
* win32_threads.c (dlopen, _beginthread): Don't undefine (since
neither redirected nor used here).
* win32_threads.c (GC_Thread_Rep): Rename "table_management" to
"tm" for short; remove "tm_" prefix.
* win32_threads.c (in_use, next): Don't define the macros; use
tm.in_use and tm.next fields, respectively (to ease debugging).
* win32_threads.c (HASH): Rename to PTHREAD_MAP_HASH (to have
unique name across the project).

13 years ago2009-10-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 17 Oct 2009 21:00:46 +0000 (21:00 +0000)]
2009-10-17  Ivan Maidanski <ivmai@mail.ru>

* include/private/gc_priv.h (I_HIDE_POINTERS): Define before gc.h
inclusion.
* include/private/gc_pmark.h (I_HIDE_POINTERS): Define if gc.h is
not included yet.
* finalize.c (I_HIDE_POINTERS): Don't define.
* include/private/dbg_mlc.h (I_HIDE_POINTERS): Ditto.
* misc.c (I_HIDE_POINTERS): Ditto.
* include/private/dbg_mlc.h (HIDE_POINTER, REVEAL_POINTER,
GC_hidden_pointer): Don't define if HIDE_POINTER is undefined.
* include/private/gc_pmark.h: Remove the comment about gc_priv.h
inclusion order.

13 years ago2009-10-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 17 Oct 2009 20:40:55 +0000 (20:40 +0000)]
2009-10-17  Ivan Maidanski <ivmai@mail.ru>

* dyn_load.c: Include gc_priv.h before using configuration
information (MACOS).
* dyn_load.c (GC_must_restore_redefined_dlopen): Rename to
GC_MUST_RESTORE_REDEFINED_DLOPEN.

13 years ago2009-10-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 17 Oct 2009 20:12:19 +0000 (20:12 +0000)]
2009-10-17  Ivan Maidanski <ivmai@mail.ru>

* backgraph.c (SET_OH_BG_PTR): Place outermost parenthesis
properly.
* darwin_stop_world.c: Replace "if DEBUG_THREADS" with
"ifdef DEBUG_THREADS".
* pthread_stop_world.c: Ditto.
* pthread_support.c: Ditto.
* include/gc_inline.h: Guard with GC_INLINE_H.

13 years ago2009-10-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 17 Oct 2009 11:18:17 +0000 (11:18 +0000)]
2009-10-17  Ivan Maidanski <ivmai@mail.ru>

* alloc.c (GC_copyright): Define as const.
* alloc.c (GC_collect_at_heapsize): Replace "static" with "STATIC"
(since the name starts with "GC_" prefix).
* dbg_mlc.c (GC_describe_type_fns): Ditto.
* dyn_load.c (GC_FirstDLOpenedLinkMap,
GC_register_dynlib_callback, GC_dyld_sections,
GC_dyld_name_for_hdr, GC_dyld_image_add, GC_dyld_image_remove):
Ditto.
* malloc.c (GC_libpthread_start, GC_libpthread_end,
GC_libld_start, GC_libld_end): Ditto.
* mark_rts.c (GC_remove_root_at_pos, GC_rebuild_root_index):
Ditto.
* os_dep.c (GC_gww_read_dirty, GC_gww_page_was_dirty,
GC_gww_page_was_ever_dirty, GC_mprotect_thread_notify,
GC_mprotect_thread_reply, GC_mprotect_thread, GC_darwin_sigbus,
GC_forward_exception): Ditto.
* pthread_support.c (GC_syms_initialized): Ditto.
* typd_mlc.c (GC_push_typed_structures_proc): Ditto.
* win32_threads.c (GC_win32_dll_threads,
GC_register_my_thread_inner, GC_lookup_pthread, GC_get_stack_min,
GC_waitForSingleObjectInfinite): Ditto.
* darwin_stop_world.c (GC_use_mach_handler_thread,
GC_use_mach_handler_thread, GC_mach_threads_count): Replace
"static" with "STATIC" and add zero initializer.
* os_dep.c (GC_task_self, GC_ports, GC_mprotect_state,
GC_sigbus_count): Ditto.
* headers.c (free_hdr): Replace "static" with GC_INLINE.
* misc.c (GC_tmp): Rename static variable to fwrite_gc_res.
* os_dep.c (memory): Rename static variable to ecos_gc_memory.
* os_dep.c (async_set_pht_entry_from_index): Make static (for
MPROTECT_VDB case).
* pthread_support.c (GC_real_pthread_create,
GC_real_pthread_sigmask, GC_real_pthread_join,
GC_real_pthread_detach, GC_init_real_syms): Use REAL_FUNC() macro
for static GC_real_XXX symbols.
* win32_threads.c (GC_may_be_in_stack): Remove "GC_" prefix.

13 years ago2009-10-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 17 Oct 2009 10:12:52 +0000 (10:12 +0000)]
2009-10-17  Ivan Maidanski <ivmai@mail.ru>

* alloc.c (GC_never_stop_func, GC_check_fl_marks,
GC_finish_collection): Reformat the code (make opening bracket
style uniform across the file).
* allchblk.c (GC_allochblk): Ditto.
* backgraph.c (add_edge): Ditto.
* dbg_mlc.c (GC_marked_for_finalization): Ditto.
* dyn_load.c (GC_register_dynamic_libraries, GC_init_dyld): Ditto.
* finalize.c (GC_null_finalize_mark_proc): Ditto.
* gc_dlopen.c (GC_dlopen): Ditto.
* mark.c (GC_push_marked1, GC_push_marked2, GC_push_marked4):
Ditto.
* misc.c (looping_handler, GC_call_with_gc_active,
GC_do_blocking_inner, GC_do_blocking): Ditto.
* os_dep.c (GC_get_main_stack_base, GC_read_dirty): Ditto.
* pthread_support.c (GC_pthread_create, GC_pthread_sigmask,
GC_pthread_join, GC_pthread_detach, GC_check_tls,
GC_do_blocking_inner, GC_call_with_gc_active): Ditto.
* reclaim.c (GC_reclaim_clear, GC_reclaim_block,
GC_print_free_list): Ditto.
* os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty,
GC_remove_protection): Reformat the code (wrap long lines).

13 years ago2009-10-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 16 Oct 2009 06:41:03 +0000 (06:41 +0000)]
2009-10-16  Ivan Maidanski <ivmai@mail.ru>

* alloc.c (GC_finish_collection): Replace getenv() with GETENV().
* dyn_load.c (GC_init_dyld): Ditto.
* os_dep.c (GC_print_callers): Ditto.
* dyn_load.c (GC_dyld_name_for_hdr): Cast _dyld_get_image_name()
result (since it's always of "struct mach_header" type).
* dyn_load.c (GC_init_dyld): Cast GC_dyld_image_add and
GC_dyld_image_remove (to always have the first argument of
"struct mach_header" pointer type).

13 years ago2009-10-16 Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
ivmai [Fri, 16 Oct 2009 06:25:28 +0000 (06:25 +0000)]
2009-10-16  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)

* configure.ac: Add threads support for OpenBSD case (threads may
not work correctly for it).
* configure: Regenerate.

13 years ago2009-10-15 Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
ivmai [Thu, 15 Oct 2009 19:39:38 +0000 (19:39 +0000)]
2009-10-15  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)

* acinclude.m4: Rename to m4/gc_set_version.m4.
* aclocal.m4: Regenerate.
* configure: Ditto.
* Makefile.in: Ditto.
* m4/libtool.m4: Delete the file.
* m4/lt~obsolete.m4: Ditto.
* m4/ltoptions.m4: Ditto.
* m4/ltsugar.m4: Ditto.
* m4/ltversion.m4: Ditto.

13 years ago2009-10-15 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 15 Oct 2009 16:41:07 +0000 (16:41 +0000)]
2009-10-15  Ivan Maidanski <ivmai@mail.ru>

* include/private/gcconfig.h: Define DebugBreak() as _exit(-1) for
x86mingw32ce toolchain to workaround the incorrect DebugBreak()
declaration in winbase.h (the workaround would turn into a no-op
when DebugBreak() will be defined as a macro in the toolchain).

13 years ago2009-10-15 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 15 Oct 2009 12:49:40 +0000 (12:49 +0000)]
2009-10-15  Ivan Maidanski <ivmai@mail.ru>

* include/private/gcconfig.h: Recognize __i386__ if WinCE (for
x86mingw32ce toolchain).
* include/private/gcconfig.h (NO_GETENV): Don't define for CeGCC
toolchain (or if already defined).
* include/private/gcconfig.h (NO_GETENV_WIN32): New macro (always
defined for WinCE or if NO_GETENV is defined).
* misc.c (GC_CreateLogFile): Use NO_GETENV_WIN32 macro instead of
NO_GETENV one.

13 years ago2009-10-15 Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
ivmai [Thu, 15 Oct 2009 06:25:01 +0000 (06:25 +0000)]
2009-10-15  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)

* configure.ac: Add AC_CONFIG_MACRO_DIR([m4]).
* Makefile.am: Add "ACLOCAL_AMFLAGS = -I m4".
* libtool.m4: Remove.
* aclocal.m4: Regenerate.
* configure: Ditto.
* Makefile.in: Ditto.
* m4/libtool.m4: New file (generated).
* m4/lt~obsolete.m4: Ditto.
* m4/ltoptions.m4: Ditto.
* m4/ltsugar.m4: Ditto.
* m4/ltversion.m4: Ditto.

13 years ago2009-10-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 10 Oct 2009 07:45:57 +0000 (07:45 +0000)]
2009-10-10  Ivan Maidanski <ivmai@mail.ru>

* include/gc.h (GC_UNDERSCORE_STDCALL): Recognize new macro;
prefix GC_CreateThread and GC_ExitThread with '_' if defined.
* doc/README.macros (GC_UNDERSCORE_STDCALL): Document.

13 years ago2009-10-09 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 9 Oct 2009 17:03:35 +0000 (17:03 +0000)]
2009-10-09  Ivan Maidanski <ivmai@mail.ru>

* alloc.c (GC_collect_or_expand): Add "retry" argument; add the
comments; don't use "default" stop_func on a retry if
GC_dont_expand.
* alloc.c (GC_collect_or_expand): Reformat the code (make the
indentation style uniform across the function).
* alloc.c (GC_allocobj): Pass "retry" argument to
GC_collect_or_expand().
* malloc.c (GC_alloc_large): Ditto.
* include/private/gc_priv.h (GC_collect_or_expand): Move the
declaration to malloc.c; add "retry" argument.

13 years ago2009-10-09 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 9 Oct 2009 07:04:46 +0000 (07:04 +0000)]
2009-10-09  Ivan Maidanski <ivmai@mail.ru>

* alloc.c (GC_start_call_back): Move the variable definition from
misc.c.
* include/private/gc_priv.h (GC_start_call_back): Remove the
declaration.
* alloc.c (GC_notify_full_gc): Remove unnecessary cast of 0.
* alloc.c (GC_try_to_collect_inner): Also call stop_func at the
beginning of the function.
* include/gc.h (GC_try_to_collect): Refine the comment about
stop_func.

13 years ago2009-10-08 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 8 Oct 2009 08:24:13 +0000 (08:24 +0000)]
2009-10-08  Ivan Maidanski <ivmai@mail.ru>

* alloc.c (GC_default_stop_func, GC_try_to_collect_general,
GC_gcollect): Add the comment.
* alloc.c (GC_try_to_collect_general): Move the assertion on
stop_func != 0 to GC_try_to_collect().
* alloc.c (GC_try_to_collect_general): If stop_func == 0 then use
GC_default_stop_func instead (holding the lock).
* alloc.c (GC_gcollect): Pass 0 as stop_func instead of
GC_default_stop_func (to prevent data races).

13 years ago2009-10-08 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 8 Oct 2009 07:17:23 +0000 (07:17 +0000)]
2009-10-08  Ivan Maidanski <ivmai@mail.ru>

* Makefile.direct: Move "define arguments" documentation to
doc/README.macros; add reference to doc/README.macros.
* Makefile.dj: Change the documentation reference to
doc/README.macros.
* README.QUICK: Ditto.
* configure.ac: Ditto.
* allchblk.c: Remove unnecessary "-D" from the comment.
* doc/README.macros: Ditto.
* README.environment: Ditto.
* include/gc.h: Ditto.
* include/gc_inline.h: Ditto.
* include/private/gcconfig.h: Ditto.
* README.QUICK: Fix a typo.
* README.QUICK: Expand all tabs to spaces.
* configure: Regenerate.
* include/private/config.h.in: Ditto.

13 years ago2009-10-07 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 7 Oct 2009 15:22:30 +0000 (15:22 +0000)]
2009-10-07  Ivan Maidanski <ivmai@mail.ru>

* misc.c (GC_CreateLogFile): Use FILE_ATTRIBUTE_NORMAL for
CreateFile(); don't immediately flush every write if very verbose.

13 years ago2009-10-07 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 7 Oct 2009 12:22:07 +0000 (12:22 +0000)]
2009-10-07  Ivan Maidanski <ivmai@mail.ru>

* doc/README.win32: Replace ".exe.log" to ".gc.log".
* doc/README.win64: Ditto.
* doc/README.win64: Fix a typo.
* misc.c (GC_CreateLogFile): Strip executable file extension for
the log file; use ".gc.log" extension (instead of ".log").

13 years ago2009-10-07 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 7 Oct 2009 06:42:34 +0000 (06:42 +0000)]
2009-10-07  Ivan Maidanski <ivmai@mail.ru>

* include/gc_config_macros.h: Avoid the redefinition of
GC_xxx_THREADS macros.

13 years ago2009-10-06 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 6 Oct 2009 16:29:55 +0000 (16:29 +0000)]
2009-10-06  Ivan Maidanski <ivmai@mail.ru>

* alloc.c (GC_try_to_collect_general): Change the type of "result"
local variable to GC_bool.

13 years ago2009-10-06 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 6 Oct 2009 16:16:01 +0000 (16:16 +0000)]
2009-10-06  Ivan Maidanski <ivmai@mail.ru>

* include/gc_config_macros.h: Use old behavior for FreeBSD and
NetBSD platform detection code (check that other GC_xxx_THREADS
are undefined); add FIXME.

13 years ago2009-10-06 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 6 Oct 2009 15:38:52 +0000 (15:38 +0000)]
2009-10-06  Ivan Maidanski <ivmai@mail.ru>

* include/gc_config_macros.h: Rearrange the platform detection
code (GC_WIN32_PTHREADS implies GC_WIN32_THREADS; define
GC_THREADS first if GC_XXX_THREADS already set; define proper
GC_XXX_THREADS if GC_THREADS; define GC_PTHREADS in a single
place; define _REENTRANT if posix threads except for Win32).
* include/gc_config_macros.h: Reformat the code (make the
indentation style uniform across the file).

13 years ago2009-10-06 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 6 Oct 2009 12:50:34 +0000 (12:50 +0000)]
2009-10-06  Ivan Maidanski <ivmai@mail.ru>

* alloc.c (GC_try_to_collect_general): New function (move the code
from GC_try_to_collect, pass force_unmap argument).
* alloc.c (GC_try_to_collect, GC_gcollect): Call
GC_try_to_collect_general().
* alloc.c (GC_gcollect_and_unmap): New public function.
* include/gc.h (GC_gcollect_and_unmap): New function declaration.
* tests/test.c (window_proc): Call GC_gcollect_and_unmap() on
WM_HIBERNATE event (instead of GC_set_force_unmap_on_gcollect()
and GC_gcollect()).

13 years ago2009-10-06 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 6 Oct 2009 10:52:03 +0000 (10:52 +0000)]
2009-10-06  Ivan Maidanski <ivmai@mail.ru>

* include/gc.h (GC_allow_register_threads, GC_register_my_thread,
GC_unregister_my_thread, GC_malloc_many): Refine the comment.
* include/gc.h (GC_malloc_many, GC_NEXT): Declare unconditionally
(that is, don't depend on GC_THREADS macro).
* include/gc.h: Don't check for __CYGWIN32__ and __CYGWIN__ along
with a check for GC_PTHREADS (since the former implies the
latter).

13 years ago2009-10-06 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 6 Oct 2009 08:01:01 +0000 (08:01 +0000)]
2009-10-06  Ivan Maidanski <ivmai@mail.ru>

* include/gc.h: Reformat the code (make the indentation style
uniform across the file).
* include/gc.h (GC_SOLARIS_THREADS): Don't check for.
* include/gc.h (GC_MIN, GC_MAX): Don't define.
* mallocx.c (GC_malloc_many): Add comment to #endif.

13 years ago2009-10-02 Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
ivmai [Fri, 2 Oct 2009 08:29:50 +0000 (08:29 +0000)]
2009-10-02  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)

* configure.ac: Drop the subdir-objects Automake option, since
it's incompatible with picking source files from libatomic_ops.
* Makefile.in: Regenerate.

13 years ago2009-10-01 Ivan Maidanski <ivmai@mail.ru> (really mostly Andreas Tobler)
ivmai [Thu, 1 Oct 2009 21:13:37 +0000 (21:13 +0000)]
2009-10-01  Ivan Maidanski <ivmai@mail.ru> (really mostly Andreas Tobler)

* allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Add
"extern" keyword to a global variable declaration (some compilers
require it).
* alloc.c (GC_bytes_found, GC_unmap_threshold,
GC_force_unmap_on_gcollect): Ditto.
* dyn_load.c (GC_no_win32_dlls, GC_wnt): Ditto.
* finalize.c (GC_fail_count): Ditto.
* include/private/gc_hdrs.h (GC_hdr_cache_hits,
GC_hdr_cache_misses): Ditto.
* mallocx.c (GC_bytes_found): Ditto.
* mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Ditto.
* misc.c (GC_unmap_threshold): Ditto.
* os_dep.c (GC_unmap_threshold, GC_old_allocator): Ditto.
* pthread_support.c (GC_markers): Ditto.
* thread_local_alloc.c (GC_gcjobjfreelist,
GC_gcj_malloc_initialized, GC_gcj_kind): Ditto.
* win32_threads.c (GC_fault_handler_lock, GC_write_cs,
GC_dont_query_stack_min, GC_markers, GC_wnt): Ditto.

13 years ago2009-10-01 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 1 Oct 2009 20:04:23 +0000 (20:04 +0000)]
2009-10-01  Ivan Maidanski <ivmai@mail.ru>

* Makefile.in: Regenerate (by autoreconf -vif, deleting libtool.m4
first and using libtool-2.2, automake-1.10.2, autoconf-2.64).
* aclocal.m4: Ditto.
* config.guess: Ditto.
* config.sub: Ditto.
* configure: Ditto.
* depcomp: Ditto.
* install-sh: Ditto.
* ltmain.sh: Ditto.
* missing: Ditto.
* mkinstalldirs: Ditto.
* include/private/config.h.in: Ditto.

13 years ago2009-10-01 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 1 Oct 2009 19:23:14 +0000 (19:23 +0000)]
2009-10-01  Ivan Maidanski <ivmai@mail.ru>

* tests/huge_test.c: Define GC_IGNORE_WARN (if not defined) to
suppress misleading GC "Out of Memory!" warning printed on every
GC_MALLOC(LONG_MAX) call.
* tests/huge_test.c: Include "gc.h" instead of <gc.h>.
* tests/huge_test.c (main): Replace K&R-style function definition
with the ANSI C one.
* tests/huge_test.c: Expand all tabs to spaces.

13 years ago2009-10-01 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 1 Oct 2009 12:48:38 +0000 (12:48 +0000)]
2009-10-01  Ivan Maidanski <ivmai@mail.ru>

* dyn_load.c (GC_register_dynamic_libraries): Always use
lpMaximumApplicationAddress value for WinCE (even for old
versions).
* os_dep.c (VER_PLATFORM_WIN32_CE): Define if not in winbase.h.
* os_dep.c (GC_dont_query_stack_min): New global variable (only if
WinCE and THREADS).
* os_dep.c (GC_setpagesize): Adjust lpMaximumApplicationAddress
for WinCE (prior to version 6) if not _WIN32_WCE_EMULATION; set
GC_dont_query_stack_min for older WinCE (prior to version 5).
* win32_threads.c (GC_dont_query_stack_min): Declare.
* win32_threads.c (GC_get_stack_min): Rename the macro to
GC_wince_evaluate_stack_min for WinCE; update the comment.
* win32_threads.c (GC_push_stack_for, GC_get_next_stack): Use
GC_wince_evaluate_stack_min() instead of GC_get_stack_min() for
WinCE and don't update thread's last_stack_min value (only if
GC_dont_query_stack_min).
* win32_threads.c (GC_push_stack_for): Skip assertion for WinCE if
GC_dont_query_stack_min (since the evaluated stack_min value may
be incorrect if the stack is bigger than 64 KiB).

13 years ago2009-10-01 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 1 Oct 2009 12:22:02 +0000 (12:22 +0000)]
2009-10-01  Ivan Maidanski <ivmai@mail.ru>

* gc_dlopen.c (GC_dlopen): Add function redirector (only if
GC_USE_LD_WRAP).
* include/gc.h: Include "gc_pthread_redirects.h" even if
GC_USE_LD_WRAP or GC_NO_THREAD_REDIRECTS.
* include/gc_pthread_redirects.h (GC_PTHREAD_REDIRECTS_H): Don't
define and check for (since included only from gc.h).
* include/gc_pthread_redirects.h: Declare "GC_" symbols even if
GC_USE_LD_WRAP or GC_NO_THREAD_REDIRECTS.
* include/gc_pthread_redirects.h: Include signal.h only to get
sigset_t definition.

13 years ago2009-09-30 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 30 Sep 2009 19:05:39 +0000 (19:05 +0000)]
2009-09-30  Ivan Maidanski <ivmai@mail.ru>

* configure: Regenerate (by autoreconf -vif, deleting libtool.m4
first).
* Makefile.in: Ditto.
* aclocal.m4: Ditto.
* include/private/config.h.in: Ditto.

13 years ago2009-09-30 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 30 Sep 2009 18:46:40 +0000 (18:46 +0000)]
2009-09-30  Ivan Maidanski <ivmai@mail.ru>

* Makefile.direct: Remove trailing spaces at EOLn.
* Makefile.direct: Document GC_REGISTER_MEM_PRIVATE.
* mark_rts.c (GC_is_tmp_root): Define also for WinCE unless
NO_DEBUGGING (that is, replace _WIN32_WCE_EMULATION with MSWINCE).
* os_dep.c (GC_sysinfo): Remove explicit global variable
initialization to "{0}" (revert back the previous change) since it
might produce a warning.

13 years ago2009-09-30 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 30 Sep 2009 17:47:48 +0000 (17:47 +0000)]
2009-09-30  Ivan Maidanski <ivmai@mail.ru>

* allchblk.c (GC_large_alloc_warn_interval): Move declaration from
gc_priv.h.
* allchblk.c (GC_large_alloc_warn_suppressed): Move definition
from misc.c; define as STATIC.
* include/private/gc_priv.h (GC_large_alloc_warn_interval,
GC_large_alloc_warn_suppressed): Remove declaration.
* alloc.c (GC_bytes_found): Add "defined in" comment.
* mallocx.c (GC_bytes_found): Ditto.
* misc.c (GC_unmap_threshold): Ditto.
* os_dep.c (GC_old_allocator): Ditto.
* pthread_support.c (GC_markers): Ditto.
* thread_local_alloc.c (GC_gcjobjfreelist,
GC_gcj_malloc_initialized, GC_gcj_kind): Ditto.
* win32_threads.c (GC_markers): Ditto.
* alloc.c (GC_start_time): Explicitly initialize to 0 or NULL (to
be distinctive from a variable declaration).
* backgraph.c (GC_max_height, GC_deepest_obj): Ditto.
* blacklst.c (GC_old_normal_bl, GC_incomplete_normal_bl,
GC_old_stack_bl, GC_incomplete_stack_bl): Ditto.
* checksums.c (GC_faulted, GC_n_dirty_errors,
GC_n_faulted_dirty_errors, GC_n_changed_errors, GC_n_clean,
GC_n_dirty, GC_bytes_in_used_blocks): Ditto.
* dbg_mlc.c (GC_smashed): Ditto.
* finalize.c (GC_old_dl_entries): Ditto.
* gcj_mlc.c (GC_gcj_kind, GC_gcj_debug_kind, GC_gcjobjfreelist,
GC_gcjdebugobjfreelist): Ditto.
* mach_dep.c (GC_save_regs_ret_val): Ditto.
* mark.c (GC_n_rescuing_pages, GC_mark_stack, GC_mark_stack_limit,
GC_mark_stack_top): Ditto.
* misc.c (GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset):
Ditto.
* os_dep.c (GC_data_start, GC_page_size, GC_sysinfo,
GC_old_segv_handler, GC_old_bus_handler,
GC_old_bus_handler_used_si, GC_old_segv_handler_used_si,
GC_proc_buf, GC_proc_fd, GC_vd_base): Ditto.
* pthread_stop_world.c (GC_stop_count, GC_stopping_pid): Ditto.
* reclaim.c (GC_leaked): Ditto.
* typd_mlc.c (GC_explicit_kind, GC_array_kind, GC_ext_descriptors,
GC_typed_mark_proc_index, GC_array_mark_proc_index,
GC_eobjfreelist, GC_arobjfreelist): Ditto.
* win32_threads.c (GC_pthread_map_cache, GC_marker_cv,
GC_marker_Id): Ditto.
* dbg_mlc.c (GC_smashed, GC_n_smashed): Define as STATIC.
* gcj_mlc.c (GC_gcjdebugobjfreelist): Ditto.
* os_dep.c (GC_vd_base): Ditto.
* pthread_support.c (GC_mark_threads): Ditto.
* reclaim.c (GC_leaked): Ditto.
* typd_mlc.c (GC_bm_table): Ditto.
* mark_rts.c (GC_save_regs_ret_val): Change declaration type to
that of definition; add "defined in" comment.
* mark_rts.c (GC_push_current_stack): Remove unnecessary cast for
GC_save_regs_ret_val.
* misc.c (GC_check_heap, GC_print_all_smashed,
GC_start_call_back): Remove unnecessary cast (of 0).
* misc.c (GC_LARGE_ALLOC_WARN_INTERVAL): New tuning macro.
* misc.c (GC_large_alloc_warn_interval): Initialize to
GC_LARGE_ALLOC_WARN_INTERVAL value.
* misc.c (GC_tmp): Change to "static".
* os_dep.c (GC_setpagesize): Reformat the code (collapse multiple
function definitions).
* os_dep.c (GC_mprotect_state): Define as static.
* pthread_support.c (dummy_thread_local): Prefix with "GC_".
* win32_threads.c (WinMain): Remove FIXME for WinCE.

13 years ago2009-09-30 Ivan Maidanski <ivmai@mail.ru> (really Hans Boehm)
ivmai [Wed, 30 Sep 2009 09:13:05 +0000 (09:13 +0000)]
2009-09-30  Ivan Maidanski <ivmai@mail.ru> (really Hans Boehm)

* os_dep.c (PROTECT, UNPROTECT): Use distinct ABORT messages.

13 years ago2009-09-30 Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
ivmai [Wed, 30 Sep 2009 08:42:33 +0000 (08:42 +0000)]
2009-09-30  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)

* configure.ac: Rewrite the tests for external or internal
libatomic_ops.
* configure.ac: In particular, drop the symbolic links. Add option
--with-libatomic-ops for forced selection.
* Makefile.am: Adjust the path of source files from libatomic_ops
to not use the links.
* Makefile.am (libgc_la_LIBADD): Add $(ATOMIC_OPS_LIBS). This will
be empty if we use the bundled AO sources.
* configure: Regenerate.
* Makefile.in: Ditto.

13 years ago2009-09-29 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 29 Sep 2009 13:50:11 +0000 (13:50 +0000)]
2009-09-29  Ivan Maidanski <ivmai@mail.ru>

* Makefile.am: Strip version suffix for libatomic_ops directory.
* build_atomic_ops.sh: Ditto.
* build_atomic_ops.sh.cygwin: Ditto.
* configure_atomic_ops.sh: Ditto.
* Makefile.direct: Remove AO_VERSION definition; strip version
suffix for libatomic_ops directory.
* NT_STATIC_THREADS_MAKEFILE: Ditto.
* NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
* NT_X64_THREADS_MAKEFILE: Ditto.
* gc.mak: Ditto.
* Makefile.in: Regenerate.

13 years ago* Moving libatomic_ops-1.2 to libatomic_ops
ivmai [Tue, 29 Sep 2009 13:41:49 +0000 (13:41 +0000)]
* Moving libatomic_ops-1.2 to libatomic_ops

13 years ago2009-09-28 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 28 Sep 2009 09:06:06 +0000 (09:06 +0000)]
2009-09-28  Ivan Maidanski <ivmai@mail.ru>

* alloc.c (GC_version): Add "const" keyword.
* alloc.c (GC_get_version): New public function.
* include/gc.h (GC_get_version): New function declaration; update
the comment for the GC version.

13 years ago2009-09-27 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 27 Sep 2009 21:19:59 +0000 (21:19 +0000)]
2009-09-27  Ivan Maidanski <ivmai@mail.ru>

* include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Use "extern"
(for the global variable declaration) again.
* include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size,
GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack,
GC_mark_stack_too_small, GC_mark_state): Ditto.
* include/private/gcconfig.h (GC_register_stackbottom): Ditto.
* include/private/pthread_support.h (GC_threads,
GC_thr_initialized, GC_in_thread_creation): Ditto.
* include/private/gc_priv.h: Ditto (for all global variables).

13 years ago2009-09-27 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 27 Sep 2009 16:53:42 +0000 (16:53 +0000)]
2009-09-27  Ivan Maidanski <ivmai@mail.ru>

* real_malloc.c: Include private/config.h if HAVE_CONFIG_H.

13 years ago2009-09-27 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 27 Sep 2009 15:06:46 +0000 (15:06 +0000)]
2009-09-27  Ivan Maidanski <ivmai@mail.ru>

* allchblk.c (GC_hblkfreelist): Define as STATIC.
* blacklst.c (GC_total_stack_black_listed): Ditto.
* include/private/gc_priv.h (GC_hblkfreelist, GC_stopped_mark,
GC_total_stack_black_listed, GC_push_stubborn_structures): Remove
declaration.
* mark_rts.c (GC_stopped_mark): Add declaration (only if
THREAD_LOCAL_ALLOC).
* allchblk.c (GC_fail_count): Move the declaration out of
GC_allochblk_nth(); remove "extern".
* alloc.c (IF_THREADS): Remove unused macro.
* alloc.c (GC_world_stopped): Define only if THREAD_LOCAL_ALLOC.
* alloc.c (GC_stopped_mark): Set GC_world_stopped value only if
THREAD_LOCAL_ALLOC.
* alloc.c (GC_bytes_found, GC_collection_in_progress,
GC_check_tls, GC_unmap_threshold, GC_force_unmap_on_gcollect):
Remove K&R-style "extern" for the declaration.
* dbg_mlc.c (GC_free_inner): Ditto.
* dyn_load.c (GC_repeat_read, GC_roots_present, GC_is_heap_base,
GC_get_next_stack, GC_no_win32_dlls, GC_wnt): Ditto.
* finalize.c (GC_fail_count): Ditto.
* include/private/gc_hdrs.h (GC_hdr_cache_hits,
GC_hdr_cache_misses): Ditto.
* include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
GC_lock, GC_collecting, GC_mark_lock_holder, GC_need_to_lock):
Ditto.
* include/private/gc_pmark.h (GC_mark_procs, GC_n_mark_procs,
GC_mark_stack_size, GC_mark_stack_limit, GC_mark_stack_top,
GC_mark_stack, GC_mark_stack_too_small, GC_mark_state): Ditto.
* include/private/gc_priv.h (GC_current_warn_proc, GC_obj_kinds,
GC_n_kinds, GC_fo_entries, GC_n_heap_sects, GC_n_memory,
GC_page_size, GC_sysinfo, GC_black_list_spacing,
GC_objects_are_marked, GC_incremental, GC_dirty_maintained,
GC_root_size, GC_debugging_started, GC_large_alloc_warn_interval,
GC_large_alloc_warn_suppressed, GC_blocked_sp,
GC_activation_frame, GC_push_other_roots,
GC_push_finalizer_structures, GC_push_thread_structures,
GC_push_typed_structures, GC_start_call_back, GC_is_initialized,
GC_check_heap, GC_print_all_smashed, GC_print_all_errors,
GC_print_heap_obj, GC_have_errors, GC_print_stats,
GC_dump_regularly, GC_backtraces, GC_print_back_height,
GC_debug_generic_malloc_inner,
GC_debug_generic_malloc_inner_ignore_off_page,
GC_fl_builder_count, GC_mark_no, GC_help_marker,
GC_setup_temporary_fault_handler, GC_reset_fault_handler): Ditto.
* include/private/gcconfig.h (GC_SysVGetDataStart,
GC_FreeBSDGetDataStart, GC_register_stackbottom,
GC_MacTemporaryNewPtr, GC_amiga_get_mem): Ditto.
* include/private/pthread_support.h (GC_threads,
GC_thr_initialized, GC_in_thread_creation): Ditto.
* malloc.c (GC_text_mapping): Ditto.
* mallocx.c (GC_bytes_found): Ditto.
* mark.c (GC_check_dirty, GC_started_thread_while_stopped): Ditto.
* mark_rts.c (GC_save_regs_ret_val): Ditto.
* misc.c (GC_clear_stack_inner, GC_init_parallel, GC_init_win32,
GC_setpagesize, GC_init_linux_data_start,
GC_set_and_save_fault_handler, GC_unmap_threshold): Ditto.
* os_dep.c (GC_unmap_threshold, GC_push_all_stacks,
GC_darwin_register_mach_handler_thread): Ditto.
* pthread_support.c (GC_markers, GC_collection_in_progress):
Ditto.
* tests/test.c (GC_amiga_free_all_mem): Ditto.
* thread_local_alloc.c (GC_gcjobjfreelist,
GC_gcj_malloc_initialized, GC_gcj_kind): Ditto.
* win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init,
GC_fault_handler_lock, GC_write_cs, GC_markers): Ditto.
* misc.c (GC_read, GC_register_finalizer_no_order, GC_init_dyld):
Move the declaration out of GC_init(); remove "extern".
* os_dep.c (GC_abort): Add the comment; add workaround to suppress
compiler "unreachable code" warnings for ABORT callers (where
ABORT is followed by a dummy return statement).
* os_dep.c (GC_old_allocator): Move the declaration out of
GC_default_push_other_roots(); remove "extern".
* darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume):
Move the declaration out of GC_stop_world() and GC_start_world()
(only if MPROTECT_VDB); remove "extern".

13 years ago2009-09-27 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 27 Sep 2009 09:09:00 +0000 (09:09 +0000)]
2009-09-27  Ivan Maidanski <ivmai@mail.ru>

* win32_threads.c (GC_get_stack_min, GC_push_stack_for,
GC_get_next_stack): Recognize _WIN32_WCE_EMULATION macro (used for
WinCE emulation and for custom WinCE 6 devices); add the comment.
* win32_threads.c (GC_get_stack_min): Cast pointer to word instead
of DWORD.
* win32_threads.c (GC_get_next_stack): Don't use and maintain the
latest known stack_min value for WinCE (if GC_get_stack_min is
defined as a macro); update the comments.
* win32_threads.c (GC_wnt): Don't declare for WinCE.

13 years ago2009-09-26 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 26 Sep 2009 21:10:54 +0000 (21:10 +0000)]
2009-09-26  Ivan Maidanski <ivmai@mail.ru>

* Makefile.direct: Document EMPTY_GETENV_RESULTS.
* gcj_mlc.c (GC_clear_stack): Remove declaration.
* malloc.c (GC_clear_stack): Ditto.
* mallocx.c (GC_clear_stack): Ditto.
* typd_mlc.c (GC_clear_stack): Ditto.
* gcj_mlc.c (GENERAL_MALLOC, GENERAL_MALLOC_IOP): Rename to
GENERAL_MALLOC_INNER and GENERAL_MALLOC_INNER_IOP, respectively;
remove "lb" unnecessary cast to word.
* include/private/gc_priv.h (GC_clear_stack): Add declaration.
* include/private/gc_priv.h (GENERAL_MALLOC, GENERAL_MALLOC_IOP):
Move common declaration from typd_mlc.c and malloc.c; remove
unnecessary result and "lb" parameter casts.
* include/private/thread_local_alloc.h: Guard against duplicate
header file inclusion.
* os_dep.c (USE_MUNMAP): Replace "-->" with an error directive for
the case when USE_MMAP is not defined.
* pthread_support.c (GC_is_thread_tsd_valid): New internal
function (only if GC_ASSERTIONS and THREAD_LOCAL_ALLOC); move the
code from thread-local GC_malloc(); add FIXME for the condition.
* win32_threads.c (GC_is_thread_tsd_valid): Ditto.
* thread_local_alloc.c (GC_gcjobjfreelist): Change the type (to
match that of its definition).
* thread_local_alloc.c (GC_destroy_thread_local): Add a cast for
GC_gcjobjfreelist.
* thread_local_alloc.c (GC_lookup_thread, GC_lookup_thread_inner):
Remove unused declaration; don't include pthread.h.
* thread_local_alloc.c (GC_is_thread_tsd_valid): New declaration
(only if GC_ASSERTIONS).
* thread_local_alloc.c (GC_malloc): Use GC_is_thread_tsd_valid()
instead of GC_lookup_thread().
* win32_threads.c (GC_lookup_thread_inner): Define as STATIC.
* win32_threads.c (UNPROTECT): Rename to UNPROTECT_THREAD (to have
id different from that in os_dep.c).

13 years ago2009-09-26 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 26 Sep 2009 15:43:34 +0000 (15:43 +0000)]
2009-09-26  Ivan Maidanski <ivmai@mail.ru>

* allchblk.c (GC_enough_large_bytes_left): Replace "inline static"
with GC_INLINE.
* include/private/gc_priv.h (fixed_getenv): Ditto.
* alloc.c (GC_max, GC_min): Replace "static INLINE" with
GC_INLINE.
* mark_rts.c (rt_hash): Ditto.
* win32_threads.c (GC_get_max_thread_index): Ditto.
* include/private/gc_priv.h (INLINE): Prefix with "GC_"; include
"static"; define for Sun CC; define for VC++ (and other
compilers).
* pthread_support.c: Don't define __inline__ for non-GNU compilers
(not needed anymore).

13 years ago2009-09-26 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 26 Sep 2009 13:23:42 +0000 (13:23 +0000)]
2009-09-26  Ivan Maidanski <ivmai@mail.ru>

* NT_THREADS_MAKEFILE: Remove file (since it duplicates gc.mak).
* Makefile.in: Remove reference to NT_THREADS_MAKEFILE.
* Makefile.am: Ditto.
* Makefile.dj: Ditto.
* Makefile.direct: Ditto.
* doc/README.win32: Add reference to gc.mak.
* NT_X64_THREADS_MAKEFILE: Ditto.

13 years ago2009-09-26 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 26 Sep 2009 12:11:16 +0000 (12:11 +0000)]
2009-09-26  Ivan Maidanski <ivmai@mail.ru>

* Makefile.in: Regenerate (by autoreconf -vif).
* aclocal.m4: Ditto.
* compile: Ditto.
* config.guess: Ditto.
* config.sub: Ditto.
* configure: Ditto.
* depcomp: Ditto.
* install-sh: Ditto.
* ltmain.sh: Ditto.
* missing: Ditto.
* mkinstalldirs: Ditto.
* include/private/config.h.in: New file (generated).
* Makefile.direct: Remove references to acinclude.m4, libtool.m4.

13 years ago2009-09-26 Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
ivmai [Sat, 26 Sep 2009 10:51:59 +0000 (10:51 +0000)]
2009-09-26  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)

* autogen.sh: Update.

13 years ago2009-09-26 Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
ivmai [Sat, 26 Sep 2009 10:38:55 +0000 (10:38 +0000)]
2009-09-26  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)

* Makefile.am: Don't add libtool.m4 to EXTRA_DIST.
* acinclude.m4: Place GC_SET_VERSION in [].
* README.QUICK: Update information for Makefile.
* Makefile.am: Replace dist_pkgconfig_DATA with pkgconfig_DATA for
bdw-gc.pc.
* configure.ac: Enable tracetest.
* tests/tests.am: Ditto.

13 years ago2009-09-26 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 26 Sep 2009 10:15:21 +0000 (10:15 +0000)]
2009-09-26  Ivan Maidanski <ivmai@mail.ru>

* dyn_load.c (GC_wnt): Update the comment.
* dyn_load.c (GC_register_dynamic_libraries): Add the comment for
_WIN32_WCE_EMULATION; recognize GC_REGISTER_MEM_PRIVATE (new
macro); call GC_is_heap_base() only if check for Type succeeded.

13 years ago2009-09-26 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 26 Sep 2009 08:33:11 +0000 (08:33 +0000)]
2009-09-26  Ivan Maidanski <ivmai@mail.ru>

* mark_rts.c (GC_is_tmp_root): Don't define unless NO_DEBUGGING;
update the comment.
* include/private/gc_priv.h (GC_is_tmp_root): Remove declaration.

13 years ago2009-09-26 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 26 Sep 2009 06:48:44 +0000 (06:48 +0000)]
2009-09-26  Ivan Maidanski <ivmai@mail.ru>

* alloc.c: Expand all tabs to spaces; remove trailing spaces at
EOLn; remove multiple trailing blank lines.
* misc.c: Ditto.
* os_dep.c: Ditto.
* pthread_support.c: Ditto.
* include/private/gc_priv.h: Ditto.
* include/private/gcconfig.h: Ditto.

13 years ago2009-09-25 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Sat, 26 Sep 2009 00:06:51 +0000 (00:06 +0000)]
2009-09-25  Hans Boehm <Hans.Boehm@hp.com>

* include/private/gcconfig.h (CANCEL_SAFE, IF_CANCEL): new macros.
* include/private/gc_priv.h (DISABLE_CANCEL, RESTORE_CANCEL,
ASSERT_CANCEL_DISABLED): New macros.
* alloc.c (GC_maybe_gc): Assert cancellation disabled.
(GC_collect_a_little_inner,GC_try_to_collect, GC_collect_or_expand):
Disable cancellation.
(GC_add_to_our_memory): Check for overflow.
* misc.c (GC_cancel_disable_count): declare.
(GC_init, GC_write): Disable cancellation.
(GC_init): Remove redundant GC_is_initialized test.
* os_dep.c (GC_repeat_read): Assert cancellation disabled.
(GC_get_stack_base): Disable cancellation.
* pthread_stop_world.c (GC_suspend_handler_inner): Disable
cancellation.
* pthread_support.c (GC_mark_thread): Permanently disable
cancellation.
(GC_wait_for_gc_completion, GC_wait_builder, GC_wait_marker):
Assert cancellation disabled.
(fork handling): Disable cancellation, fix comment.
(GC_pthread_create): Disable cancellation.
(GC_unregister_my_thread): Disable cancellation.
* Makefile.direct: Document NO_CANCEL_SAFE.

13 years ago2009-09-25 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 25 Sep 2009 18:59:02 +0000 (18:59 +0000)]
2009-09-25  Ivan Maidanski <ivmai@mail.ru>

* Makefile: Remove outdated file (Makefile.direct should be used
instead).

13 years ago2009-09-25 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 25 Sep 2009 12:23:46 +0000 (12:23 +0000)]
2009-09-25  Ivan Maidanski <ivmai@mail.ru>

* win32_threads.c: Reformat the code (make indentation and
opening bracket style uniform across the file; wrap long code and
comment lines).

13 years ago2009-09-25 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 25 Sep 2009 10:42:37 +0000 (10:42 +0000)]
2009-09-25  Ivan Maidanski <ivmai@mail.ru>

* include/gc.h (GC_use_DllMain): Refine (and reformat) the
comment.

13 years ago2009-09-25 Ivan Maidanski <ivmai@mail.ru> (really mostly Petter Urkedal)
ivmai [Fri, 25 Sep 2009 07:48:30 +0000 (07:48 +0000)]
2009-09-25  Ivan Maidanski <ivmai@mail.ru> (really mostly Petter Urkedal)

* configure.ac: Add documentation to AC_DEFINE for GC_THREADS and
EMPTY_GETENV_RESULTS.
* configure.ac: Fix a typo.
* Makefile.am: Ditto.

13 years ago2009-09-25 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 25 Sep 2009 07:13:13 +0000 (07:13 +0000)]
2009-09-25  Ivan Maidanski <ivmai@mail.ru>

* checksums.c (GC_checksum, GC_update_check_page): Remove
"register" keyword in local variable declarations (for the code
used only for debugging or which is not time-critical).
* dbg_mlc.c (GC_has_other_debug_info, GC_store_debug_info,
GC_store_debug_info_inner, GC_check_annotated_obj, GC_print_obj,
GC_print_smashed_obj, GC_debug_end_stubborn_change,
GC_debug_invoke_finalizer): Ditto.
* dyn_load.c (GC_register_dynamic_libraries): Ditto.
* mallocx.c (GC_realloc): Ditto.
* mark_rts.c (GC_print_static_roots, GC_is_static_root,
GC_clear_roots): Ditto.
* misc.c (GC_write): Ditto.
* os_dep.c (GC_print_callers): Ditto.
* dyn_load.c (GC_register_dynamic_libraries): Rename "i" local
variable to "j" for the nested loop (just not to hide the similar
variable in the outer one).
* mark_rts.c (GC_print_static_roots): Output an error message
using GC_err_printf() (instead of GC_printf()).

13 years ago2009-09-25 Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
ivmai [Fri, 25 Sep 2009 05:13:53 +0000 (05:13 +0000)]
2009-09-25  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)

* configure.ac: Move include flag from ${INCLUDE} ...
* Makefile.am: ... to AM_CPPFLAGS and also add the build directory.
* configure.ac: Call AM_CONFIG_HEADER([include/private/config.h]).
* configure.ac: Add documentation to all AC_DEFINE either directly
or using AH_TEMPLATE.

13 years ago2009-09-24 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 24 Sep 2009 11:54:47 +0000 (11:54 +0000)]
2009-09-24  Ivan Maidanski <ivmai@mail.ru>

* win32_threads.c (GC_waitForSingleObjectInfinite): New static
function (only if GC_WINMAIN_REDIRECT).
* win32_threads.c (WinMain): Call GC_waitForSingleObjectInfinite()
thru GC_do_blocking() instead of calling WaitForSingleObject()
directly.

13 years ago2009-09-24 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 24 Sep 2009 08:21:32 +0000 (08:21 +0000)]
2009-09-24  Ivan Maidanski <ivmai@mail.ru>

* pthread_support.c (start_mark_threads): Refine printed message.
* win32_threads.c (GC_thr_init): Ditto.
* win32_threads.c: Reformat some code pieces (wrap too long code
lines).

13 years ago2009-09-24 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 24 Sep 2009 07:31:03 +0000 (07:31 +0000)]
2009-09-24  Ivan Maidanski <ivmai@mail.ru>
(ivmai145.diff)

* Makefile.direct (GC_WINMAIN_REDIRECT): Add the comment for.
* Makefile.direct (NO_GETENV): Update the comment.
* include/gc.h (GC_WINMAIN_WINCE_LPTSTR): Remove macro.
* include/gc.h (GC_WinMain): Remove declaration.
* include/gc.h (WinMain): Define (as GC_WinMain) if and only if
GC_WINMAIN_REDIRECT.
* tests/test.c (GC_COND_INIT): Define as GC_INIT() also in case of
WinCE target unless GC_WINMAIN_REDIRECT is defined.
* tests/test.c (WINMAIN_LPTSTR): New macro.
* tests/test.c (WinMain): Use WINMAIN_LPTSTR instead of LP[W]STR
and GC_WINMAIN_WINCE_LPTSTR.
* win32_threads.c (start_mark_threads): Add the comment for
MARK_THREAD_STACK_SIZE.
* win32_threads.c: Recognize new GC_WINMAIN_REDIRECT macro.
* win32_threads.c (WINMAIN_LPTSTR, WINMAIN_THREAD_STACK_SIZE): New
macro (only if GC_WINMAIN_REDIRECT).
* win32_threads.c: Undefine WinMain macro if GC_WINMAIN_REDIRECT.
* win32_threads.c (GC_WinMain): Add prototype (only if
GC_WINMAIN_REDIRECT).
* win32_threads.c (main_thread_args, WinMain): Rename
GC_WINMAIN_WINCE_LPTSTR to WINMAIN_LPTSTR.
* win32_threads.c (WinMain): Call GC_INIT() instead of GC_init();
use WINMAIN_THREAD_STACK_SIZE.
* win32_threads.c (WinMain): Call GC_deinit() and
DeleteCriticalSection() only if WinCE; add FIXME.

13 years ago2009-09-24 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 24 Sep 2009 07:20:18 +0000 (07:20 +0000)]
2009-09-24  Ivan Maidanski <ivmai@mail.ru>

* os_dep.c (GC_get_main_stack_base): add assertion for mem_base
value returned by GC_get_stack_base().

13 years ago2009-09-23 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 23 Sep 2009 06:57:52 +0000 (06:57 +0000)]
2009-09-23  Ivan Maidanski <ivmai@mail.ru>
(ivmai150.diff)

* Makefile.direct (MUNMAP_THRESHOLD, GC_FORCE_UNMAP_ON_GCOLLECT):
Add the comment for.
* alloc.c (GC_unmap_threshold, GC_force_unmap_on_gcollect):
Declare external variable (only if USE_MUNMAP).
* alloc.c (GC_try_to_collect): Temporarily set GC_unmap_threshold
value to 1 if GC_force_unmap_on_gcollect and restore it before
unlocking (only if USE_MUNMAP).
* doc/README.environment (GC_FORCE_UNMAP_ON_GCOLLECT): Add
information for.
* include/gc.h (GC_set_force_unmap_on_gcollect,
GC_get_force_unmap_on_gcollect): New public function prototype.
* include/gc.h (GC_FORCE_UNMAP_ON_GCOLLECT): New macro is
recognized.
* misc.c (GC_FORCE_UNMAP_ON_GCOLLECT): Ditto.
* include/gc.h (GC_INIT_CONF_FORCE_UNMAP_ON_GCOLLECT): New
internal macro (used by GC_INIT only).
* misc.c (GC_force_unmap_on_gcollect): New global variable.
* misc.c (GC_init): Recognize new "GC_FORCE_UNMAP_ON_GCOLLECT"
environment variable (and set GC_force_unmap_on_gcollect).
* misc.c (GC_set_force_unmap_on_gcollect,
GC_get_force_unmap_on_gcollect): New public function.
* tests/test.c (window_proc): Call GC_set_force_unmap_on_gcollect
to force the mode on if WM_HIBERNATE; restore the mode after
GC_gcollect().

13 years ago2009-09-23 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 23 Sep 2009 06:53:48 +0000 (06:53 +0000)]
2009-09-23  Ivan Maidanski <ivmai@mail.ru>

* Makefile.direct (LARGE_CONFIG): Update information.
* include/gc.h (GC_stop_func): Refine the comment.

13 years ago2009-09-21 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 21 Sep 2009 08:46:03 +0000 (08:46 +0000)]
2009-09-21  Ivan Maidanski <ivmai@mail.ru>

* configure.ac: Use EMPTY_GETENV_RESULTS instead of NO_GETENV for
Win32 (workaround for Wine bug).

13 years ago2009-09-20 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 20 Sep 2009 08:07:27 +0000 (08:07 +0000)]
2009-09-20  Ivan Maidanski <ivmai@mail.ru>

* allchblk.c (GC_freehblk): Adjust local variables indentation.
* mallocx.c (GC_generic_malloc_many): Ditto.
* typd_mlc.c (GC_malloc_explicitly_typed_ignore_off_page,
GC_calloc_explicitly_typed): Ditto.
* typd_mlc.c (GC_make_array_descriptor): Remove unnecessary
brackets.

13 years ago2009-09-20 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 20 Sep 2009 06:58:00 +0000 (06:58 +0000)]
2009-09-20  Ivan Maidanski <ivmai@mail.ru>

* configure.ac: Replace GC_WIN32_THREADS with GC_THREADS.
* configure.ac: Process enable_parallel_mark option for Cygwin and
Win32; define THREAD_LOCAL_ALLOC for Win32.

13 years ago2009-09-20 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 20 Sep 2009 06:27:16 +0000 (06:27 +0000)]
2009-09-20  Ivan Maidanski <ivmai@mail.ru>

* include/private/gc_priv.h: Define AO_ASSUME_WINDOWS98 if
PARALLEL_MARK (required for VC++ x86).

13 years ago2009-09-19 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 19 Sep 2009 18:20:26 +0000 (18:20 +0000)]
2009-09-19  Ivan Maidanski <ivmai@mail.ru>
(ivmai149.diff)

* dbg_mlc.c (GC_generate_random_backtrace): Call
GC_try_to_collect(GC_never_stop_func) instead of GC_gcollect();
if GC is disabled then print error message and return.
* include/gc.h (GC_try_to_collect): Refine the comment.
* include/private/gc_priv.h (GC_never_stop_func): Fix return type;
refine the comment.

13 years ago2009-09-19 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 19 Sep 2009 11:43:14 +0000 (11:43 +0000)]
2009-09-19  Ivan Maidanski <ivmai@mail.ru>
(ivmai147.diff)

* add_gc_prefix.c: Move the file to the new "extra" directory.
* AmigaOS.c: Ditto.
* gcname.c: Ditto.
* if_mach.c: Ditto.
* if_not_there.c: Ditto.
* MacOS.c: Ditto.
* msvc_dbg.c: Ditto.
* setjmp_t.c: Ditto.
* threadlibs.c: Ditto.
* EMX_MAKEFILE: Prepend setjmp_t.c with "extra" directory.
* Makefile: Prepend AmigaOS.c, MacOS.c, add_gc_prefix.c, gcname.c,
if_mach.c, if_not_there.c, msvc_dbg.c, setjmp_t.c, threadlibs.c
with "extra" directory.
* Makefile.am: Ditto.
* Makefile.direct: Ditto.
* Makefile.dj: Ditto.
* Makefile.in: Ditto.
* NT_MAKEFILE: Prepend msvc_dbg.obj with "extra" directory.
* NT_STATIC_THREADS_MAKEFILE: Ditto.
* NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
* NT_X64_THREADS_MAKEFILE: Ditto.
* NT_THREADS_MAKEFILE: Prepend msvc_dbg.c with "extra" directory.
* gc.mak: Ditto.
* PCR-Makefile: Prepend if_mach.c, if_not_there.c with "extra"
directory.
* SMakefile.amiga: Prepend AmigaOS.c, setjmp_t.c with "extra"
directory.
* doc/simple_example.html: Update for threadlibs.c.
* os_dep.c: Prepend included AmigaOS.c with "extra" directory.

13 years ago2009-09-19 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 19 Sep 2009 11:23:29 +0000 (11:23 +0000)]
2009-09-19  Ivan Maidanski <ivmai@mail.ru>
* allchblk.c: Expand all tabs to spaces; remove trailing spaces at
EOLn; remove multiple trailing blank lines.
* mark.c: Ditto.
* mark_rts.c: Ditto.
* pthread_stop_world.c: Ditto.
* win32_threads.c: Ditto.
* include/gc.h: Ditto.
* include/private/gc_priv.h: Ditto.
* pthread_stop_world.c: Add copyright header.
* include/gc.h: Reformat some comments.

13 years ago2009-09-19 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 19 Sep 2009 09:28:28 +0000 (09:28 +0000)]
2009-09-19  Ivan Maidanski <ivmai@mail.ru>
(ivmai130a.diff, ivmai130b.diff - superseding diff44, diff69)

* include/gc.h (GC_do_blocking, GC_call_with_gc_active): New
function prototype.
* include/private/gc_priv.h (STOP_WORLD): Replace a no-op (for the
single-threaded case) with an assertion check for the state to be
not a "do-blocking" one.
* include/private/gc_priv.h (blocking_data): Move the structure
definition from pthread_support.c; change "fn" return type to void
pointer.
* include/private/gc_priv.h (GC_activation_frame_s): New structure
type.
* include/private/gc_priv.h (GC_push_all_stack_frames): New
function declaration (only if THREADS).
* include/private/gc_priv.h (GC_world_stopped): Don't declare
unless THREADS.
* include/private/gc_priv.h (GC_blocked_sp,
GC_activation_frame_s): New declaration (only if not THREADS).
* include/private/gc_priv.h (GC_push_all_register_frames): New
function declaration (only for IA-64).
* include/private/gc_priv.h (NURSERY, GC_push_proc): Remove
obsolete (unused) symbols.
* include/private/gc_priv.h (GC_push_all_stack_partially_eager):
Remove declaration (since it is static now).
* mark_rts.c (GC_push_all_stack_partially_eager): Move from mark.c
(for code locality) and make STATIC.
* mark_rts.c (GC_push_all_register_frames): New function (only for
IA-64).
* mark_rts.c (GC_push_all_stack_frames): New function (only if
THREADS).
* mark_rts.c (GC_add_trace_entry): New function prototype (used by
GC_push_all_stack_partially_eager(), only if TRACE_BUF).
* mark_rts.c (GC_push_all_stack_part_eager_frames): New function.
* mar_rts.c (GC_save_regs_ret_val): Move the declaration out of a
function body (only for IA-64).
* mark_rts.c (GC_push_current_stack): Call
GC_push_all_stack_part_eager_frames() instead of
GC_push_all_stack_partially_eager().
* mark_rts.c (GC_push_current_stack): Call
GC_push_all_register_frames() instead of GC_push_all_eager() for
IA-64 backing store.
* misc.c (GC_do_blocking_inner): Declare function (if THREADS
only).
* misc.c (GC_blocked_sp, GC_blocked_register_sp,
GC_activation_frame): New global variables (only if not THREADS).
* misc.c (GC_call_with_gc_active, GC_do_blocking_inner): New API
function (only if not THREADS).
* misc.c (GC_do_blocking): Move the function from
pthread_support.c.
* include/private/pthread_support.h (GC_Thread_Rep): Add
"activation_frame" field.
* pthread_stop_world.c (GC_push_all_stacks): Call
GC_push_all_stack_frames() and GC_push_all_register_frames instead
of GC_push_all_stack() and/or GC_push_all_eager(); don't check for
STACK_GROWS_UP here.
* pthread_support.c (GC_do_blocking_inner): Remove "static"; store
"fn" result back to "client_data" field.
* pthread_support.c (GC_call_with_gc_active): New API function.
* win32_threads.c (GC_call_with_gc_active): Ditto.
* win32_threads.c (GC_Thread_Rep): Add "thread_blocked_sp" and
"activation_frame" fields.
* win32_threads.c (GC_new_thread): Add assertion checking for
thread_blocked_sp is NULL.
* win32_threads.c (GC_do_blocking_inner): New function.
* win32_threads.c (GC_stop_world): Don't suspend a thread if its
thread_blocked_sp is non-NULL.
* win32_threads.c (GC_push_stack_for): Use thread
"activation_frame" (if non-NULL); use "thread_blocked_sp" if
non-NULL (instead of calling GetThreadContext()); "UNPROTECT" the
thread before modifying its last_stack_min; call
GC_push_all_stack_frames() instead of GC_push_all_stack(); update
the comments.

13 years ago2009-09-19 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 19 Sep 2009 09:19:24 +0000 (09:19 +0000)]
2009-09-19  Ivan Maidanski <ivmai@mail.ru>
(ivmai129.diff - superseding diff47)

* alloc.c (GC_default_stop_func): New static variable (initialized
to GC_never_stop_func).
* alloc.c (GC_set_stop_func, GC_get_stop_func): New function.
* alloc.c (GC_timeout_stop_func): Define as GC_default_stop_func
(instead of GC_never_stop_func) if SMALL_CONFIG (or NO_CLOCK),
else call GC_default_stop_func() before getting "current_time".
* alloc.c (GC_maybe_gc): Expand GC_gcollect_inner() macro (for
FIXME comment).
* alloc.c (GC_maybe_gc, GC_collect_a_little_inner): add FIXME for
replacing GC_never_stop_func with GC_default_stop_func (if
possible).
* alloc.c (GC_gcollect): Use GC_default_stop_func.
* alloc.c (GC_collect_or_expand): Use GC_default_stop_func
(instead of GC_never_stop_func) unless it is trigged due to out of
memory; don't increment GC_fail_count and don't output warning
(before trying to collect again) in case the collection has been
interrupted (by GC_default_stop_func) and the heap expansion has
failed too.
* include/gc.h (GC_set_stop_func, GC_get_stop_func): New function
prototypes.

13 years ago2009-09-19 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 19 Sep 2009 08:51:40 +0000 (08:51 +0000)]
2009-09-19  Ivan Maidanski <ivmai@mail.ru>

* os_dep.c (GC_get_stack_base): Add FIXME; add assertion for
GC_get_writable_length() result.

13 years ago2009-09-18 Ivan Maidanski <ivmai@mail.ru> (really Ludovic CourtXs)
ivmai [Fri, 18 Sep 2009 20:16:16 +0000 (20:16 +0000)]
2009-09-18  Ivan Maidanski <ivmai@mail.ru> (really Ludovic CourtXs)

* configure.ac: Don't use -lpthread -ldl for Cygwin.

13 years ago2009-09-18 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 18 Sep 2009 07:43:11 +0000 (07:43 +0000)]
2009-09-18  Ivan Maidanski <ivmai@mail.ru>

* NT_THREADS_MAKEFILE: Make it back equal to gc.mak.

13 years ago2009-09-18 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 18 Sep 2009 05:51:52 +0000 (05:51 +0000)]
2009-09-18  Ivan Maidanski <ivmai@mail.ru>
(ivmai142.diff)

* include/private/gcconfig.h (GWW_VDB): Undefine if
USE_GLOBAL_ALLOC (since incompatible).
* os_dep.c (GetWriteWatch_alloc_flag): Define as 0 unless GWW_VDB
is defined.
* os_dep.c (GC_unmap_threshold): Declare (for use in
GC_init_win32) if USE_MUNMAP.
* os_dep.c (GC_init_win32): Turn off memory unmapping if
GlobalAlloc() is used.
* os_dep.c (GC_win32_get_mem): Define and use new
VIRTUAL_ALLOC_PAD macro; don't waste a extra memory page unless
MPROTECT_VDB is in use.

13 years ago2009-09-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 17 Sep 2009 19:11:47 +0000 (19:11 +0000)]
2009-09-17  Ivan Maidanski <ivmai@mail.ru>

* Makefile: Replace "version.h" with "include/gc_version.h".
* include/gc_version.h: Ditto.

13 years ago2009-09-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 17 Sep 2009 07:18:33 +0000 (07:18 +0000)]
2009-09-17  Ivan Maidanski <ivmai@mail.ru>

* alloc.c (GC_collect_or_expand): Output heap size in WARN()
(before returning FALSE) for convenience.

13 years ago2009-09-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 17 Sep 2009 06:43:26 +0000 (06:43 +0000)]
2009-09-17  Ivan Maidanski <ivmai@mail.ru>
(ivmai139.diff)

* allchblk.c (GC_allochblk_nth): Use GC_PRIdPTR in WARN() format
string.
* pthread_support.c (start_mark_threads, GC_thr_init): Ditto.
* win32_threads.c (GC_delete_thread): Ditto.
* include/private/gc_priv.h (GC_PRIdPTR): New macro.
* pthread_stop_world.c (GC_suspend_handler_inner): Remove
unnecessary cast for WARN argument.
* pthread_support.c (start_mark_threads): if pthread_create()
failed then don't try to create other marker threads and (after
printing a warning) adjust GC_markers and GC_parallel values; log
GC_markers value (possibly adjusted) after that.

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 16 Sep 2009 20:31:48 +0000 (20:31 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru>
(ivmai140.diff)

* win32_threads.c (start_mark_threads): if pthread_create() is
failed then don't try to create other marker threads and (after
printing a warning) adjust GC_markers and GC_parallel values.
* win32_threads.c (mark_mutex_event, builder_cv, mark_cv): Move
the definition upper (to be visible in start_mark_threads()).
* win32_threads.c (start_mark_threads): if CreateThread() or
_beginthreadex() is failed then don't try to create other marker
threads and (after printing a warning) adjust GC_markers,
GC_parallel values, and destroy the event objects (either only
some for the uncreated threads if DONT_USE_SIGNALANDWAIT or all if
not a single thread is created).
* win32_threads.c (GC_thr_init): Log GC_markers value (possibly
adjusted) after start_mark_threads() call.

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 16 Sep 2009 19:16:17 +0000 (19:16 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru>

* Makefile.am: Back remove "GC_" prefix for PTHREADS,
DARWIN_THREADS, WIN32_THREADS (for configure.ac).

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 16 Sep 2009 14:43:37 +0000 (14:43 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru>

* ChangeLog: Remove trailing spaces at EOLn; insert blank lines
where missed.
* doc/README: Expand all tabs to spaces; remove trailing spaces at
EOLn; remove multiple trailing blank lines.
* doc/README.autoconf: Ditto.
* doc/README.DGUX386: Ditto.
* doc/README.environment: Ditto.
* doc/README.macros: Ditto.
* doc/README.win32: Ditto.
* tests/test.c: Ditto.
* tests/test_cpp.cc: Ditto.
* backgraph.c: Ditto.
* blacklst.c: Ditto.
* checksums.c: Ditto.
* darwin_stop_world.c: Ditto.
* dbg_mlc.c: Ditto.
* dyn_load.c: Ditto.
* finalize.c: Ditto.
* gc_dlopen.c: Ditto.
* gcj_mlc.c: Ditto.
* headers.c: Ditto.
* mach_dep.c: Ditto.
* malloc.c: Ditto.
* mallocx.c: Ditto.
* new_hblk.c: Ditto.
* obj_map.c: Ditto.
* ptr_chck.c: Ditto.
* real_malloc.c: Ditto.
* reclaim.c: Ditto.
* stubborn.c: Ditto.
* thread_local_alloc.c: Ditto.
* typd_mlc.c: Ditto.
* gc_cpp.cc: Ditto.
* include/gc_allocator.h: Ditto.
* include/gc_backptr.h: Ditto.
* include/gc_config_macros.h: Ditto.
* include/gc_cpp.h: Ditto.
* include/gc_gcj.h: Ditto.
* include/gc_inline.h: Ditto.
* include/gc_mark.h: Ditto.
* include/gc_pthread_redirects.h: Ditto.
* include/gc_typed.h: Ditto.
* include/gc_version.h: Ditto.
* include/javaxfc.h: Ditto.
* include/new_gc_alloc.h: Ditto.
* include/private/darwin_semaphore.h: Ditto.
* include/private/dbg_mlc.h: Ditto.
* include/private/gc_hdrs.h: Ditto.
* include/private/gc_locks.h: Ditto.
* include/private/gc_pmark.h: Ditto.
* include/private/gcconfig.h: Ditto.
* include/private/pthread_support.h: Ditto.
* include/private/thread_local_alloc.h: Ditto.
* darwin_stop_world.c: Add copyright header.
* include/gc_backptr.h: Ditto.
* include/gc_config_macros.h: Ditto.
* include/gc_pthread_redirects.h: Ditto.
* include/gc_version.h: Ditto.
* include/javaxfc.h: Ditto.
* include/private/darwin_semaphore.h: Ditto.
* include/private/pthread_support.h: Ditto.
* gc_cpp.cc: Make copyright header uniform across the package.
* include/gc_cpp.h: Ditto.

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
ivmai [Wed, 16 Sep 2009 12:07:42 +0000 (12:07 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
(gc_config_h_6a.patch with a minor correction)

* include/private/gc_priv.h: Change include of config.h to
private/config.h.
* include/private/gc_pmark.h: Ditto.
* gc_cpp.cc: Ditto.
* tests/test.c: Ditto.
* tests/test_cpp.cc: Include private/config.h (if HAVE_CONFIG_H);
undefine GC_BUILD.

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 16 Sep 2009 10:27:22 +0000 (10:27 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru>
(ivmai128.diff - superseding diff62, diff66 partly)

* finalize.c (GC_general_register_disappearing_link): Return
GC_SUCCESS, GC_DUPLICATE, GC_NO_MEMORY (instead of 0, 1 and 2,
respectively).
* include/gc.h (GC_NO_MEMORY): New macro (defined as 2).
* include/gc.h (GC_register_disappearing_link,
GC_general_register_disappearing_link): Update the comment.
* typd_mlc.c (GC_calloc_explicitly_typed): Use GC_NO_MEMORY macro.
* finalize.c (GC_general_register_disappearing_link,
GC_register_finalizer_inner): Recalculate the hash table index
after GC_oom_fn succeeded (since the table may grow while not
holding the lock) and check again that the entry is still not in
the table (free the unused entry otherwise unless DBG_HDRS_ALL).
* finalize.c (GC_register_finalizer_inner): Initialize "hhdr"
local variable (to prevent a compiler warning).
* finalize.c (GC_register_finalizer_inner): Don't modify the data
pointed by "ocd" and "ofn" in GC_register_finalizer_inner() failed
(due to out of memory).

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 16 Sep 2009 10:23:35 +0000 (10:23 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru>
(ivmai124.diff - superseding diff67 partly)

* alloc.c (GC_set_fl_marks, GC_clear_fl_marks): Transform loop to
suppress compiler "variable might be uninitialized" warnings.

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 16 Sep 2009 09:27:58 +0000 (09:27 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru>
(ivmai138.diff)

* Makefile.direct (DONT_USE_SIGNALANDWAIT): Add the comment for.
* win32_threads.c (DONT_USE_SIGNALANDWAIT): Always define for
WinCE.
* win32_threads.c (THREAD_HANDLE): Cast Id (of DWORD type) to
HANDLE thru word type (to avoid a compiler warning) for WinCE.
* win32_threads.c (GC_marker_cv, GC_marker_Id): New static array
(only if DONT_USE_SIGNALANDWAIT).
* win32_threads.c (start_mark_threads): Initialize GC_marker_Id
and GC_marker_cv for each helper thread (only if
DONT_USE_SIGNALANDWAIT).
* win32_threads.c (GC_mark_mutex_state): New static variable (only
if DONT_USE_SIGNALANDWAIT).
* win32_threads.c (GC_mark_mutex_waitcnt,
signalObjectAndWait_func): Don't define if DONT_USE_SIGNALANDWAIT.
* win32_threads.c (GC_acquire_mark_lock, GC_release_mark_lock):
Use InterlockedExchange() over GC_mark_mutex_state (instead of
AO_fetch_and_add()) if DONT_USE_SIGNALANDWAIT.
* win32_threads.c (GC_wait_marker, GC_notify_all_marker):
Implement wait/broadcast primitives using Win32 multiple events
(one for each marker thread) if DONT_USE_SIGNALANDWAIT (instead of
using Win32 SignalObjectAndWait).
* win32_threads.c (GC_thr_init): Don't declare hK32 local
variable, don't check for GC_wnt, and don't initialize
signalObjectAndWait_func if DONT_USE_SIGNALANDWAIT.

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 16 Sep 2009 09:08:33 +0000 (09:08 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru>
(ivmai127.diff - superseding diff49)

* alloc.c (GC_finish_collection): Call GC_print_finalization_stats
if GC_print_stats (after getting "done_time").
* finalize.c (GC_old_dl_entries): New static variable (only if not
SMALL_CONFIG).
* finalize.c (GC_finalize): Save current GC_dl_entries value (only
if not SMALL_CONFIG).
* finalize.c (GC_print_finalization_stats): Define if and only if
not SMALL_CONFIG; use GC_old_dl_entries value; use GC_log_printf()
instead of GC_printf(); use "%lu" (instead of "%u") print format
specifier; use unsigned long type for "ready" counter (for LP64
targets).
* misc.c (GC_dump): No longer call GC_print_finalization_stats()
here (since it is called from GC_finish_collection()).
* misc.c (STACKBASE): Remove unused macro undef (for NOSYS and
ECOS).

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 16 Sep 2009 09:03:54 +0000 (09:03 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru>
(ivmai134.diff)

* alloc.c (GC_expand_hp): Replace GC_init_inner() call with
GC_init() one.
* malloc.c (GC_alloc_large, GC_generic_malloc_inner): Ditto.
* mallocx.c (GC_generic_malloc_many): Ditto.
* misc.c (GC_enable_incremental): Ditto.
* alloc.c (GC_expand_hp): Update the comment.
* mark.c (GC_obj_kinds): Ditto.
* win32_threads.c (GC_allow_register_threads): Ditto.
* private/gc_priv.h (GC_init_inner): Remove function declaration.
* misc.c (GC_init_inner): Replace with public GC_init().

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 16 Sep 2009 08:59:10 +0000 (08:59 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru>
(ivmai126.diff)

* gcj_mlc.c (GC_gcj_fake_mark_proc): New static function.
* gcj_mlc.c (GC_init_gcj_malloc): If mp is 0 then supply
GC_gcj_fake_mark_proc (aborting with the appropriate message)
instead.

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 16 Sep 2009 08:55:33 +0000 (08:55 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru>
(ivmai125.diff)

* os_dep.c (GC_wince_get_mem): If VirtualAlloc() returns NULL (due
to out of memory) then don't increment GC_n_heap_bases and don't
call VirtualAlloc() again (with MEM_COMMIT).
* os_dep.c (GC_remap): Abort with a more informatory message if
VirtualAlloc() fails due to out of memory; update FIXME.

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 16 Sep 2009 08:50:53 +0000 (08:50 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru>
(ivmai132.diff - superseding diff41a, diff64, diff84 partly)

* Makefile: Fix typo for msvc_dbg.c.
* Makefile.direct: Ditto.
* Makefile.am: Prefix PTHREADS, DARWIN_THREADS, WIN32_THREADS with
"GC_".
* Makefile.dj: Don't reference remove files (nursery.c,
gc_nursery.h, gc_copy_descr.h).
* NT_MAKEFILE: Don't define __STDC__ macro (no longer used).
* NT_STATIC_THREADS_MAKEFILE: Ditto.
* NT_THREADS_MAKEFILE: Ditto.
* NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
* NT_X64_THREADS_MAKEFILE: Ditto.
* gc.mak: Ditto.
* NT_MAKEFILE: Remove unnecessary -DGC_BUILD (since it is always
defined in the source files).
* NT_THREADS_MAKEFILE: Ditto.
* NT_X64_THREADS_MAKEFILE: Ditto.
* gc.mak: Ditto.
* NT_X64_THREADS_MAKEFILE: Fix typo for -DGC_NOT_DLL.
* NT_STATIC_THREADS_MAKEFILE: Replace GC_WIN32_THREADS with
GC_THREADS.
* NT_THREADS_MAKEFILE: Ditto.
* NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
* NT_X64_THREADS_MAKEFILE: Ditto.
* gc.mak: Ditto.
* NT_MAKEFILE: Define _CRT_SECURE_NO_DEPRECATE to suppress the
compiler warnings.
* NT_STATIC_THREADS_MAKEFILE: Ditto.
* NT_X64_STATIC_THREADS_MAKEFILE: Place -D_CRT_SECURE_NO_DEPRECATE
before "$*.C" (and "$*.CPP").
* NT_X64_THREADS_MAKEFILE: Ditto.

13 years ago2009-09-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 16 Sep 2009 08:44:21 +0000 (08:44 +0000)]
2009-09-16  Ivan Maidanski <ivmai@mail.ru>
(ivmai131.diff - superseding diff83, diff84 partly)

* doc/README.solaris2: Replace GC_SOLARIS_THREADS with GC_THREADS.
* doc/README.win32: Replace GC_WIN32_THREADS with GC_THREADS.
* doc/README.win64: Add info about mingw-w64; add note for VC++
warnings suppression.

13 years ago2009-09-15 Hans Boehm <Hans.Boehm@hp.com> (Mostly Juan Jose Garcia-Ripoll)
hboehm [Tue, 15 Sep 2009 18:24:57 +0000 (18:24 +0000)]
2009-09-15 Hans Boehm <Hans.Boehm@hp.com> (Mostly Juan Jose Garcia-Ripoll)
(Also similar to, but not the same as, Ivan's diff104_cvs)

* os_dep.c (GC_forward_exception): Fix logic in several places.
(OSX-specific)

13 years ago2009-09-15 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 15 Sep 2009 17:46:21 +0000 (17:46 +0000)]
2009-09-15  Ivan Maidanski <ivmai@mail.ru>
(ivmai137v2.diff)

* include/private/gc_priv.h (MAX_HEAP_SECTS): Guard with ifndef.