Skip to content

Commit

Permalink
Merge branch 'jpellegrini-libgc-8.2.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
egallesio committed Sep 23, 2024
2 parents 95963ec + de386fa commit 85d19e7
Show file tree
Hide file tree
Showing 39 changed files with 454 additions and 223 deletions.
2 changes: 1 addition & 1 deletion PACKAGES-USED
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ the full version counterpart.

GC: The Boehm's conservative garbage collector for C and C++
============================================================
- Version: 8.2.6
- Version: 8.2.8
- License: Free (BSD-like)
- Home Page: https://www.hboehm.info/gc/

Expand Down
4 changes: 4 additions & 0 deletions gc/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Daniel R. Grayson <[email protected]>
Danny Smith <[email protected]>
Darrell Schiebel <[email protected]>
Dave Barrett <[email protected]>
Dave Barton <[email protected]>
Dave Detlefs <[email protected]>
Dave Korn <[email protected]>
Dave Love <[email protected]>
Expand Down Expand Up @@ -158,6 +159,7 @@ Emmanual Stumpf
Eric Benson <[email protected]>
Eric Holk <[email protected]>
Erik M. Bray <[email protected]>
Fabian Ruffy <[email protected]>
Fabian Thylman
Fabrice Fontaine <[email protected]>
Fergus Henderson <[email protected]>
Expand Down Expand Up @@ -363,6 +365,7 @@ Phillip Musumeci <[email protected]>
Phong Vo <[email protected]>
Pierre de Rop
Pontus Rydin <[email protected]>
Qing Guo <[email protected]>
Radek Polak <[email protected]>
Rainer Orth <[email protected]>
Ranjit Mathew <[email protected]>
Expand Down Expand Up @@ -396,6 +399,7 @@ Samuel Thibault <[email protected]>
Scott Ananian <[email protected]>
Scott Ferguson <[email protected]>
Scott Schwartz <[email protected]>
Seonghyun Kim <[email protected]>
Shawn Wagner <[email protected]>
Shea Levy <[email protected]>
Shiro Kawai <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions gc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

cmake_minimum_required(VERSION 3.5)

set(PACKAGE_VERSION 8.2.6)
set(PACKAGE_VERSION 8.2.8)
# Version must match that in AC_INIT of configure.ac and that in README.
# Version must conform to: [0-9]+[.][0-9]+[.][0-9]+

# Info (current:revision:age) for the Libtool versioning system.
# These values should match those in cord/cord.am and Makefile.am.
set(LIBCORD_VER_INFO 6:1:5)
set(LIBGC_VER_INFO 6:3:5)
set(LIBGC_VER_INFO 6:4:5)
set(LIBGCCPP_VER_INFO 6:0:5)

option(enable_cplusplus "C++ support" OFF)
Expand Down
106 changes: 105 additions & 1 deletion gc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@

== [8.2.8] 2024-09-08 ==

* Allow GC_size() argument to be null
* Disable backtrace saving at garbage collections if DONT_SAVE_TO_LAST_STACK
* Eliminate 'cast signed to bigger unsigned' CSA warnings in GC_find_limit
* Eliminate 'x might be clobbered by longjmp' gcc warning in setjmp_t.c
* Fix 'un-mprotect vdb failed' abort with out-of-memory reason on Linux
* Fix ADD_CALL_CHAIN() placement to follow GC_store_debug_info_inner call
* Fix GC_debug_realloc to support custom kind
* Fix GC_is_visible for case of arg pointing exactly to object upper bound
* Fix GC_print_trace_inner to print the last element of the circular buffer
* Fix cordtst2.tmp file deletion in cordtest on Windows
* Fix double lock in GC_malloc called from backtrace()
* Fix handling of page-unaligned boundaries in soft_set_grungy_pages
* Fix heap blocks size computation by GC_get_memory_use
* Fix indent of a closing curly braces in GC_apply_to_all_blocks
* Fix infinite resend lost signals if a thread is restarted by SIGQUIT
* Fix null pointer dereference in GC_is_visible if type_descr is null
* Fix per_object_helper() after changing hb_sz units
* Fix pointer relational comparison in GC_do_enumerate_reachable_objects
* Fix poor thread-local allocation performance because of double EXTRA_BYTES
* Fix potential GC_add_roots_inner call with an overflowed pointer (Win32)
* Fix potential address overflow in GC_add_to_heap
* Fix potential buffer overrun during read in GC_text_mapping
* Fix various typos in comments
* Prevent GC_noop_sink from scanning by the collector
* Prevent redirected malloc call from a garbage collection routine
* Redirect malloc_usable_size() in leak_detector.h
* Remove redundant dirty/reachable_here calls in GC_malloc_explicitly_typed
* Update and fix diagrams describing the tree structure for pointer lookups
* Use atomic store to set GC_first_nonempty in GC_do_parallel_mark
* Use atomic store to set entry id and update cache_ptr in slow_getspecific
* Workaround '.obj file not found' error reported by watcom wlib


== [8.2.6] 2024-02-04 ==

* Avoid unexpected heap growth in gctest for the case of VERY_SMALL_CONFIG
Expand Down Expand Up @@ -83,7 +118,7 @@
* Adjust WoW64 workaround to work on UWP/WinRT
* Adjust naming of Win32/64 and x86/64 words in comments and documentation
* Avoid potential race between realloc and GC_block_was_dirty
* Do not double-clear first two words of object in GC_generic_malloc_aligned
* Do not double-clear first two words of object in GC_generic_malloc
* Do not mention FASTLOCK in comment
* Do not mix debug and non-debug allocations in disclaim tests
* Do not prohibit threaded builds with malloc redirection on non-Linux
Expand Down Expand Up @@ -523,6 +558,14 @@
* Workaround various cppcheck false positives


== [8.0.14] 2024-09-07 ==

* Disable backtrace saving at garbage collections if DONT_SAVE_TO_LAST_STACK
* Fix infinite resend lost signals if a thread is restarted by SIGQUIT

Also, includes 7.6.22 changes


== [8.0.12] 2024-02-04 ==

* Eliminate 'make_key is defined but unused' gcc warning in threadkeytest
Expand Down Expand Up @@ -1052,6 +1095,17 @@ Also, includes 7.6.18 changes
* Workaround Thread Sanitizer (TSan) false positive warnings


== [7.6.22] 2024-09-07 ==

* Eliminate 'cast signed to bigger unsigned' CSA warnings in GC_find_limit
* Fix GC_debug_realloc to support custom kind
* Fix heap blocks size computation by GC_get_memory_use
* Fix pointer relational comparison in GC_do_enumerate_reachable_objects
* Prevent GC_noop_sink from scanning by the collector

Also, includes 7.4.28 changes


== [7.6.20] 2024-02-03 ==

* Eliminate compiler warning of missing cast in LONG_MULT after shift
Expand Down Expand Up @@ -1632,6 +1686,27 @@ Also, includes 7.4.6 changes
Also, includes 7.4.4 changes


== [7.4.28] 2024-09-07 ==

* Avoid gcc stringop-overflow warning for intended overflow in smashtest
* Fix ADD_CALL_CHAIN() placement to follow GC_store_debug_info_inner call
* Fix GC_is_visible for case of arg pointing exactly to object upper bound
* Fix GC_print_trace_inner to print the last element of the circular buffer
* Fix cordtst2.tmp file deletion in cordtest on Windows
* Fix double lock in GC_malloc called from backtrace()
* Fix indent of a closing curly braces in GC_apply_to_all_blocks
* Fix null pointer dereference in GC_is_visible if type_descr is null
* Fix per_object_helper() after changing hb_sz units
* Fix poor thread-local allocation performance because of double EXTRA_BYTES
* Fix potential GC_add_roots_inner call with an overflowed pointer (Win32)
* Fix potential address overflow in GC_add_to_heap
* Fix potential buffer overrun during read in GC_text_mapping
* Fix typos in comments
* Prevent redirected malloc call from a garbage collection routine
* Remove redundant dirty/reachable_here calls in GC_malloc_explicitly_typed
* Update and fix diagrams describing the tree structure for pointer lookups


== [7.4.26] 2024-02-03 ==

* Eliminate 'unused parameter' gcc warning in free() if IGNORE_FREE
Expand Down Expand Up @@ -2206,6 +2281,35 @@ Also, includes 7.2e, 7.2d, 7.2c, 7.2b changes
Also, includes 7.2 changes


== [7.2s] 2024-09-06 ==

* Avoid gcc stringop-overflow warning for intended overflow in smashtest
* Eliminate 'type defaults to int in declaration' warning (REDIRECT_MALLOC)
* Eliminate 'value exceeds maximum object size' GCC warning in huge_test
* Eliminate warning and simplify expression in GC_init_explicit_typing
* Fix 'GetVersion deprecated' compiler warning in os_dep (MS VC)
* Fix 'value truncated' compiler warning in CORD_cat (MS VC)
* Fix ADD_CALL_CHAIN() placement to follow GC_store_debug_info_inner call
* Fix GC_is_visible for case of arg pointing exactly to object upper bound
* Fix GC_jmp_buf multiple definition
* Fix GC_print_trace_inner to print the last element of the circular buffer
* Fix double lock in GC_malloc called from backtrace()
* Fix indent of a closing curly braces in GC_apply_to_all_blocks
* Fix null pointer dereference in GC_is_visible if type_descr is null
* Fix per_object_helper() after changing hb_sz units
* Fix poor thread-local allocation performance because of double EXTRA_BYTES
* Fix potential GC_add_roots_inner call with an overflowed pointer (Win32)
* Fix potential address overflow in GC_add_to_heap
* Fix potential buffer overrun during read in GC_text_mapping
* Fix typos in comments
* Prevent compiler warnings regarding unused argument and printf in extra
* Prevent redirected malloc call from a garbage collection routine
* Remove barrett_diagram file duplicated by tree.html
* Remove non-existing DISCARD_WORDS from GC data structure ASCII diagram
* Resolve GCC warning in setjmp_t.c
* Update and fix diagrams describing the tree structure for pointer lookups


== [7.2r] 2024-02-03 ==

* Fix 'g++ not found' error on OpenBSD (Makefile.direct)
Expand Down
2 changes: 1 addition & 1 deletion gc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Info (current:revision:age) for the Libtool versioning system.
# These numbers should be updated at most once just before the release,
# and, optionally, at most once during the development (after the release).
LIBGC_VER_INFO = 6:3:5
LIBGC_VER_INFO = 6:4:5
LIBGCCPP_VER_INFO = 6:0:5

## FIXME: `make distcheck' in this directory will not currently work.
Expand Down
2 changes: 1 addition & 1 deletion gc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ top_srcdir = @top_srcdir@
# Info (current:revision:age) for the Libtool versioning system.
# These numbers should be updated at most once just before the release,
# and, optionally, at most once during the development (after the release).
LIBGC_VER_INFO = 6:3:5
LIBGC_VER_INFO = 6:4:5
LIBGCCPP_VER_INFO = 6:0:5

# We currently use the source files directly from libatomic_ops, if we
Expand Down
2 changes: 1 addition & 1 deletion gc/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Boehm-Demers-Weiser Garbage Collector

This is version 8.2.6 of a conservative garbage
This is version 8.2.8 of a conservative garbage
collector for C and C++.


Expand Down
20 changes: 10 additions & 10 deletions gc/WCC_MAKEFILE
Original file line number Diff line number Diff line change
Expand Up @@ -95,24 +95,24 @@ OBJS= alloc.obj reclaim.obj allchblk.obj backgraph.obj checksums.obj &

gc.lib: $(OBJS)
@%create $*.lb1
@for %i in ($(OBJS)) do @%append $*.lb1 +'%i'
@for %i in ($(OBJS)) do @%append $*.lb1 +%i
*wlib -b -c -n -p=512 $@ @$*.lb1

cord.lib: $(COBJS)
@%create $*.lb1
@for %i in ($(COBJS)) do @%append $*.lb1 +'%i'
@for %i in ($(COBJS)) do @%append $*.lb1 +%i
*wlib -b -c -n -p=512 $@ @$*.lb1

gccpp.lib: gc_badalc.obj gc_cpp.obj
@%create $*.lb1
@%append $*.lb1 +'gc_badalc.obj'
@%append $*.lb1 +'gc_cpp.obj'
@%append $*.lb1 +gc_badalc.obj
@%append $*.lb1 +gc_cpp.obj
*wlib -b -c -n -p=512 $@ @$*.lb1

# The same as gccpp.lib but contains only gc_badalc.obj.
gctba.lib: gc_badalc.obj
@%create $*.lb1
@%append $*.lb1 +'gc_badalc.obj'
@%append $*.lb1 +gc_badalc.obj
*wlib -b -c -n -p=512 $@ @$*.lb1

!else
Expand All @@ -134,7 +134,7 @@ gc.dll: gc.obj .AUTODEPEND
!endif
@%append $*.lnk op case
@%append $*.lnk name $*
@%append $*.lnk file 'gc.obj'
@%append $*.lnk file gc.obj
*wlink @$*.lnk

cord.lib: cord.dll
Expand All @@ -151,7 +151,7 @@ cord.dll: $(COBJS) gc.lib .AUTODEPEND
!endif
@%append $*.lnk op case
@%append $*.lnk name $*
@for %i in ($(COBJS)) do @%append $*.lnk file '%i'
@for %i in ($(COBJS)) do @%append $*.lnk file %i
@%append $*.lnk library gc.lib
*wlink @$*.lnk

Expand All @@ -169,8 +169,8 @@ gccpp.dll: gc_badalc.obj gc_cpp.obj gc.lib .AUTODEPEND
!endif
@%append $*.lnk op case
@%append $*.lnk name $*
@%append $*.lnk file 'gc_badalc.obj'
@%append $*.lnk file 'gc_cpp.obj'
@%append $*.lnk file gc_badalc.obj
@%append $*.lnk file gc_cpp.obj
@%append $*.lnk library gc.lib
@%append $*.lnk library wr7$(CALLING)dll.lib
*wlink @$*.lnk
Expand All @@ -189,7 +189,7 @@ gctba.dll: gc_badalc.obj gc.lib .AUTODEPEND
!endif
@%append $*.lnk op case
@%append $*.lnk name $*
@%append $*.lnk file 'gc_badalc.obj'
@%append $*.lnk file gc_badalc.obj
@%append $*.lnk library gc.lib
@%append $*.lnk library wr7$(CALLING)dll.lib
*wlink @$*.lnk
Expand Down
2 changes: 1 addition & 1 deletion gc/allchblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ STATIC struct hblk * GC_get_first_part(struct hblk *h, hdr *hhdr,
* appropriate free list.
* N replaces h in the original free list.
*
* Nhdr is not completely filled in, since it is about to allocated.
* Nhdr is not completely filled in, since it is about to be allocated.
* It may in fact end up on the wrong free list for its size.
* That's not a disaster, since n is about to be allocated
* by our caller.
Expand Down
15 changes: 5 additions & 10 deletions gc/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,7 @@ STATIC void GC_maybe_gc(void)
/* used instead of GC_never_stop_func here. */
if (GC_stopped_mark(GC_time_limit == GC_TIME_UNLIMITED?
GC_never_stop_func : GC_timeout_stop_func)) {
# ifdef SAVE_CALL_CHAIN
GC_save_callers(GC_last_stack);
# endif
SAVE_CALLERS_TO_LAST_STACK();
GC_finish_collection();
} else {
if (!GC_is_full_gc) {
Expand Down Expand Up @@ -621,9 +619,7 @@ GC_INNER GC_bool GC_try_to_collect_inner(GC_stop_func stop_func)
}
GC_invalidate_mark_state(); /* Flush mark stack. */
GC_clear_marks();
# ifdef SAVE_CALL_CHAIN
GC_save_callers(GC_last_stack);
# endif
SAVE_CALLERS_TO_LAST_STACK();
GC_is_full_gc = TRUE;
if (!GC_stopped_mark(stop_func)) {
if (!GC_incremental) {
Expand Down Expand Up @@ -736,9 +732,7 @@ GC_INNER void GC_collect_a_little_inner(int n)

if (i < max_deficit && !GC_dont_gc) {
/* Need to finish a collection. */
# ifdef SAVE_CALL_CHAIN
GC_save_callers(GC_last_stack);
# endif
SAVE_CALLERS_TO_LAST_STACK();
# ifdef PARALLEL_MARK
if (GC_parallel)
GC_wait_for_reclaim();
Expand Down Expand Up @@ -1408,7 +1402,7 @@ STATIC void GC_add_to_heap(struct hblk *p, size_t bytes)
if (0 == bytes) return;
}
endp = (word)p + bytes;
if (endp <= (word)p) {
while (endp <= (word)p) {
/* Address wrapped. */
bytes -= HBLKSIZE;
if (0 == bytes) return;
Expand Down Expand Up @@ -1474,6 +1468,7 @@ STATIC void GC_add_to_heap(struct hblk *p, size_t bytes)
GC_greatest_real_heap_addr = endp;
}
# endif
GC_handle_protected_regions_limit();
if (old_capacity > 0) {
# ifndef GWW_VDB
/* Recycling may call GC_add_to_heap() again but should not */
Expand Down
2 changes: 1 addition & 1 deletion gc/backgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ static void per_object_helper(struct hblk *h, word fn)
do {
f((ptr_t)(h -> hb_body + i), sz, descr);
i += sz;
} while (i + sz <= BYTES_TO_WORDS(HBLKSIZE));
} while (i + sz <= HBLKSIZE);
}

GC_INLINE void GC_apply_to_each_object(per_object_func f)
Expand Down
Loading

0 comments on commit 85d19e7

Please sign in to comment.