2008-07-25 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
Ivan's description of the patch follows. Note that a few pieces like
the GC_malloc(0) patch, were not applied since an alternate had been
previously applied. A few differed stylistically from the rest of
the code (mostly casts to void * instead of target type),
or were classified as too minor to bother. Note that
all of Ivan's static declarations which did not correct outright
naming bugs (as a few did), where replaced by STATIC, which is
ignored by default.
- minor bug fixing (for FreeBSD, for THREAD_LOCAL_ALLOC and for
GC_malloc(0));
- addition of missing getter/setter functions for public variables
(may be useful if compiled as Win32 DLL);
- addition of missing GC_API for some exported functions;
- addition of missing "static" declarator for internal functions
and variables (where possible);
- replacement of all remaining K&R-style definitions with ANSI
C ones (__STDC__ macro is not used anymore);
- addition of some Win32 macro definitions (that may be missing in
the standard headers supplied with a compiler) for GWW_VDB mode;
- elimination of most compiler warnings (except for
"uninitialized data" warning);
- several typos correction;
- missing parenthesis addition in macros in some header files of
"libatomic_ops" module.
My highlights based on reading the patch:
* allchblk.c: Remove GC_freehblk_ptr decl.
Make free_list_index_of() static.
* include/gc.h: Use __int64 on win64, define GC_oom_func,
GC_finalizer_notifier_proc, GC_finalizer_notifier_proc,
add getter and setters: GC_get_gc_no, GC_get_parallel,
GC_set_oom_fn, GC_set_finalize_on_demand,
GC_set_java_finalization, GC_set_dont_expand,
GC_set_no_dls, GC_set_max_retries, GC_set_dont_precollect,
GC_set_finalizer_notifier. Always define GC_win32_free_heap.
gc_config_macros.h: Define _REENTRANT after processing
GC_THREADS.
* include/gc_cpp.h: Improve GC_PLACEMENT_DELETE test,
handling of operator new[] for old Windows compilers.
* include/gc_inline.h (GC_MALLOC_FAST_GRANS): Add parentheses
around arguments.
* dbg_mlc.c, malloc.c, misc.c: Add many GC_API specs.
* mark.c (GC_mark_and_push_stack): Fix source argument for
blacklist printing.
* misc.c: Fix log file naming based on environment variable
for Windows. Make GC_set_warn_proc and GC_set_free_space_divisor
just return current value with 0 argument. Add DONT_USER_USER32_DLL.
Add various getters and setters as in gc.h.
* os_dep.c: Remove no longer used GC_disable/enable_signals
implementations. (GC_get_stack_base): Add pthread_attr_destroy
call. No longer set GC_old_bus_handler in DARWIN workaround.
* pthread_support.c: GC_register_my_thread must also
call GC_init_thread_local.
2008-07-21 Hans Boehm <Hans.Boehm@hp.com>
* Makefile.direct, mach_dep.c: Add support for NO_GETCONTEXT.
* mach_dep.c: Include signal.h.
* gc_priv.h: Factor out INLINE declaration.
hboehm [Wed, 20 Feb 2008 18:48:42 +0000 (18:48 +0000)]
2008-02-20 Hans Boehm <Hans.Boehm@hp.com>
* allchblk.c (GC_enough_large_bytes_left): No longer take
parameters; return free list index bound.
(GC_merge_unmapped): Don't access nexthdr until after null test.
(Fixes bug in 1/29/08 check-in.) (GC_allochblk): Calculate
when splitting is allowable only once here, not when considering each
block. (GC_allchblk_nth): Accept new may_split parameter.
Avoid some redundant tests for exact size matches.
* alloc.c (GC_should_collect): Cache min_bytes_allocd.
(GC_maybe_gc): Make locking assertion testable.
* mark_rts.c: Fix indentation.
* pthread_stop_world.c: Replace old GC_err_printf1 reference.
* tests/test.c: Remove (void) casts. Optionally print some
timing information.
hboehm [Wed, 30 Jan 2008 01:37:16 +0000 (01:37 +0000)]
2008-01-29 Hans Boehm <Hans.Boehm@hp.com>
* allchblk.c (GC_merge_unmapped, GC_freehblk): Refuse to create
blocks large enough that their size, when interpreted as a signed
value, would be negative.
* include/private/gc_priv.h: Comment hb_sz range limit.
hboehm [Thu, 10 Jan 2008 21:47:52 +0000 (21:47 +0000)]
2008-01-10 Hans Boehm <Hans.Boehm@hp.com>
* configure.ac: Ignore --enable-parallel-mark on Darwin for now.
* configure: Regenerate.
* darwin_stop_world.c: Add FIXME comment for parallel marker.
hboehm [Sat, 22 Dec 2007 01:05:43 +0000 (01:05 +0000)]
2007-12-21 Hans Boehm <Hans.Boehm@hp.com>
* alloc.c: Define GC_version instead of in version.h.
* version.h: Remove.
* include/gc_version.h: Move most of version.h here.
* include/gc.h: Include gc_version.h.
* gcname.c, add_gc_prefix.c: include gc.h instead of version.h.
* Makefile.direct, Makefile.dj, Makefile.am: Adjust for
version.h rename.
2007-12-21 Hans Boehm <Hans.Boehm@hp.com> (Really mostly russ sludge dot net)
* configure.ac: Put libatomic_ops links in build directory.
* configure: Regenerate.
* Makefile.am: Dont mention atomic_ops.c and atomic_ops_sysdeps.S
as nodist sources.
a_tobler [Mon, 10 Dec 2007 18:49:55 +0000 (18:49 +0000)]
2007-12-10 Andreas Tobler <a.tobler@schweiz.org>
* dyn_load.c (GC_dyld_image_add): Remove ifdef clause and use the macro
GC_GETSECTBYNAME instead.
* include/private/gc_priv.h: Define GC_GETSECTBYNAME according to the
architecture (Darwin).
hboehm [Tue, 14 Aug 2007 20:33:52 +0000 (20:33 +0000)]
2007-08-14 Hans Boehm <Hans.Boehm@hp.com> (really mostly Samuel Thibault)
* dbg_mlc.c: Use random() on all glibc systems.
* mach_dep.c (GC_with_callee_saves_pushed): Don't use getcontext() on
HURD. Add comment.
* pthread_stop_world.c (GC_suspend_handler, GC_stop_init): Accomodate
systems without SA_SIGINFO.
hboehm [Sat, 4 Aug 2007 06:26:29 +0000 (06:26 +0000)]
2007-08-03 Hans Boehm <Hans.Boehm@hp.com>
* alloc.c, backgraph.c, headers.c, include/private/gc_priv.h:
Maintain GC_our_memory and GC_n_memory.
* dbg_mlc.c (GC_print_smashed_obj): Improve message.
(GC_print_all_smashed_proc): Pass client object address instead of
base.
* dyn_load.c (sort_heap_sects): New. (GC_register_map_entries):
Register sections that are contiguous and merged with our heap.
* malloc.c, os_dep.c (GC_text_mapping): Check for just base name
of libraries.
* malloc.c (calloc): Check for special callers even with
USE_PROC_FOR_LIBRARIES. Move assertion. Add rudimentary
malloc/free tracing.
* misc.c: No longer call GC_init_lib_bounds explicitly.
* thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Always
initialize on demand.
* tests/test.c: Call GC_INIT only when required.
* alloc.c (GC_stopped_mark): Call GC_add_current_malloc_heap()
while world is still running.
* os_dep.c (GC_is_heap_base): Don't call GC_add_current_malloc_heap()
with world stopped.
* include/gc.h (GC_INIT for cygwin): Always call GC_add_roots.
* misc.c (GC_init/GC_init_inner): Perform all work in
GC_init_inner.
* Makefile.direct: Expand -DUSE_MUNMAP comment.
2007-07-23 Hans Boehm <Hans.Boehm@hp.com> (really Jim Marshall)
* include/gc.h: Define uintptr_t explicitly for VC++6.
* msvc_dbg.c (GetModuleBase): Revert to strcat if strcat_s doesn't
exist.
* include/gc_config_macros.h: Also check for IA64 when setting
GC_HPUX_THREADS.
* mallocx.c: Change my_bytes_allocd to signed_word.
* include/gc_pthread_redirects.h: Remove obsolete Solaris threads
(as opposed to pthreads) support.
hboehm [Tue, 19 Jun 2007 18:27:41 +0000 (18:27 +0000)]
2007-06-19 Hans Boehm <Hans.Boehm@hp.com>
* alloc.c (GC_adj_bytes_allocd): Avoid (long) casts, fix comment.
(GC_print_heap_sects): Use size_t instead of unsigned long.
* thread_local_alloc.c (GC_lookup_thread): Define in the correct
context.
* win32_threads.c, include/gc_config_macros.h: The last of Romano
Paolo Tenca's patch. Move stdint.h include to gc_config_macros.h.
* include/gc_inline.h: Avoid gc_priv.h dependencies.
* tests/test.c (check_heap_stats): Replace unsigned long with size_t.
hboehm [Thu, 7 Jun 2007 02:53:32 +0000 (02:53 +0000)]
2007-06-06 Hans Boehm <Hans.Boehm@hp.com>
* Makefile.am, Makefile.direct: Add NT_X64_STATIC_THREADS_MAKEFILE.
* Makefile.in: Regenerate.
* NT_X64_STATIC_THREADS_MAKEFILE: Fix warning flags.
* allochblk.c, alloc.c, blacklst.c, dbg_malc.c, dyn_load.c,
finalize.c, headers.c, mach_dep.c, malloc.c, mark.c, misc.c,
obj_map.c, os_dep.c, ptr_chck.c, reclaim.c, typd_mlc.c,
win32_threads.c, cord/de_win.c, include/gc_mark.h,
include/private/gc_hdrs.h, include/private/gc_pmark.h,
include/private/gc_priv.h, tests/test_cpp.cc:
Replace old style function declarations. Clean up integral types.
Remove register declarations. The change in malloc.c and the
"int descr" declaration in mark.c are the most likely to have
been real bugs outside of win64.
* msvc_dbg.c: Disable on win64.
* win32_threads.c: Add AMD64 support.
* include/gc.h: no backtrace on AMD64 for now.
hboehm [Wed, 6 Jun 2007 19:58:55 +0000 (19:58 +0000)]
2007-06-06 Hans Boehm <Hans.Boehm@hp.com>
* include/gc.h: (GC_word, GC_signed_word): Fix win64 definitions.
Don't include windows.h in an extern "C" context.
* include/private/gcconfig.h: Fix win64/X86_64 configuration.
* tests/test.c: Eliminate more old style function definitions.
Cleanup pointer and integer casts for win64.
* tests/test_cpp.cc: Don't include gc_priv.h.
* NT_STATIC_THREADS_MAKEFILE: Restrict suffixes for VC++ 2005.
* NT_X64_STATIC_THREADS_MAKEFILE: New.
hboehm [Wed, 6 Jun 2007 19:49:20 +0000 (19:49 +0000)]
2007-06-06 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Romano Paolo Tenca)
* include/gc.h: (GC_word, GC_signed_word): Fix win64 definitions.
Don't include windows.h in an extern "C" context.
* include/private/gcconfig.h: Fix win64/X86_64 configuration.
* tests/test.c: Eliminate more old style function definitions.
Cleanup pointer and integer casts for win64.
* tests/test_cpp.cc: Don't include gc_priv.h.
* NT_STATIC_THREADS_MAKEFILE: Restrict suffixes for VC++ 2005.
* NT_X64_STATIC_THREADS_MAKEFILE: New.
hboehm [Wed, 6 Jun 2007 19:29:05 +0000 (19:29 +0000)]
2007-06-06 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Romano Paolo Tenca)
* win32_threads.c: Separate out DEBUG_WIN32_PTHREADS_STACK. Ignore
FINISHED threads for suspension. (GC_pthread_join): Add
pthread_self() cast. (GC_pthread_start_inner): Execute cleanup
handler when popping it.
* include/private/gc_locks.h: Inline THREAD_EQUAL for
GC_WIN32_PTHREADS. Define USE_PTHREAD_LOCKS only if we have
pthreads.
hboehm [Thu, 24 May 2007 05:18:06 +0000 (05:18 +0000)]
2007-05-23 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Romano Paolo Tenca)
* gc_dlopen.c, thread_local_alloc.c, threadlibs.c, win32_threads.c,
tests/test.c: Accomodate GC_WIN32_PTHREADS.
* include/gc.h: Don't include windows.h for GC_WIN32_PTHREADS.
* include/gc_config_macros.h: Define both PTHREADS and
GC_WIN32_THREADS.
* include/private/gc_locks.h: Nonstandard definitions of
NUMERIC_THREAD_ID for GC_WIN32_PTHREADS.
* doc/README.win32, Makefile.direct: Include documentation
for GC_WIN32_PTHREADS.
* Makefile.direct: Remove some anachronisms in the documentation.
hboehm [Tue, 22 May 2007 19:35:54 +0000 (19:35 +0000)]
2007-05-22 Hans Boehm <Hans.Boehm@hp.com>
* malloc.c(GC_free): Ignore bad frees on MSWIN32 with REDIRECT_MALLOC.
* NT_MAKEFILE: msvc_dbg.h is in include/private. Don't use cvars
rc.
* misc.c (WIN32 GC_write): Define GC_need_to_lock in single-threaded
case.
* win32_threads.c: Test for __MINGW32__ in addition to _MINGW_VER.
(GC_CreateThread, GC_beginthreadex): Deallocate args even if we fail.
* include/gc.h: Add GC_reachable_here(). (GC_WinMain): Add GC_API.
(GC_beginthreadex, GC_endthreadex, GC_ExitThread): Declare.
* tests/test.c: Add GC_reachable_here() call.
hboehm [Fri, 11 May 2007 00:30:36 +0000 (00:30 +0000)]
2007-05-10 Hans Boehm <Hans.Boehm@hp.com>
* include/gc_cpp.h: Documentation updates.
* include/gc_config_macros.h: Don't check for __ppc__ to set
DARWIN_THREADS.
* Makefile.am: Include configure_atomic_ops.sh in dist.
* Makefile.in: Regenerate.
hboehm [Tue, 1 May 2007 20:45:14 +0000 (20:45 +0000)]
2007-05-01 Hans Boehm <Hans.Boehm@hp.com>
(and Manuel Serrano, Craig McDaniel)
* configure.ac: Comment out redundant
AC_DEFINE(NO_EXECUTE_PERMISSION).
* configure: Regenerate.
* sparc_mach_dep.S: Remove single quote in comment.
* include/private/gcconfig.h: Fix DATAEND for NONSTOP.
* win32_threads.c: Include stdint.h for Mingw. Add GC_API for DllMain.
(GC_use_DllMain): Fix assertion.
a_tobler [Wed, 14 Feb 2007 20:13:00 +0000 (20:13 +0000)]
2007-02-14 Andreas Tobler <a.tobler@schweiz.org>
* configure.ac: Introduce extra_ldflags_libgc. Use it for Darwin.
* configure: Regenerate.
* Makefile.am (libgc_la_LDFLAGS): Use extra_ldflags_libgc.
* Makefile.in: Regenerate.
* include/private/gcconfig.h: Enable MPROTECT_VDB for all Darwin
targets. Remove comments.
Prepare ppc64 support for Darwin.
hboehm [Thu, 25 Jan 2007 23:43:10 +0000 (23:43 +0000)]
2007-01-25 Petr Salinger and Hans Boehm <Hans.Boehm@hp.com>
* include/private/gc_priv.h (NEED_FIND_LIMIT, FREEBSD variant):
also define for X86_64.
* configure.ac: Move generic gnu (Hurd) case to below kfreebsd case.
* configure: Regenerate.
* doc/README.changes: Point to ChangeLog.
a_tobler [Thu, 25 Jan 2007 05:18:27 +0000 (05:18 +0000)]
2007-01-25 Andreas Tobler <a.tobler@schweiz.org>
* darwin_stop_world.c: Move THREAD_FLD defines to ...
* include/private/gc_priv.h: ... here.
Fix THREAD_STATE definitions for ppc64.
* os_dep.c (catch_exception_raise): Use THREAD_FLD for exc_state member
access.