+2007-01-03 Hans Boehm <Hans.Boehm@hp.com> (based on a patch from
+ John Bowman, and an ancient patch from Fergus Henderson)
+
+ * allchblk.c, alloc.c, include/private/gc_priv.h:
+ Track GC_bytes_dropped and use in GC triggering decisions.
+ * alloc.c (min_bytes_allocd): Weight atomic blocks less.
+
2007-01-02 Hans Boehm <Hans.Boehm@hp.com>
* alloc.c (GC_add_to_heap): Call GC_install_header(p) AFTER
struct hblk * prev = hhdr -> hb_prev;
GC_large_free_bytes -= total_size;
+ GC_bytes_dropped += total_size;
GC_remove_from_fl(hhdr, n);
for (h = hbp; h < limit; h++) {
if (h == hbp || 0 != (hhdr = GC_install_header(h))) {
if (stack_size < 0) stack_size = -stack_size;
total_root_size = 2 * stack_size + GC_root_size;
- scan_size = 2 * GC_composite_in_use + GC_atomic_in_use
+ scan_size = 2 * GC_composite_in_use + GC_atomic_in_use/4
+ total_root_size;
if (TRUE_INCREMENTAL) {
return scan_size / (2 * GC_free_space_divisor);
/* managed object should not alter result, assuming the client */
/* is playing by the rules. */
result = (signed_word)GC_bytes_allocd
+ + (signed_word)GC_bytes_dropped
- (signed_word)GC_bytes_freed
+ (signed_word)GC_finalizer_bytes_freed
- expl_managed;
GC_bytes_allocd_before_gc += GC_bytes_allocd;
GC_non_gc_bytes_at_gc = GC_non_gc_bytes;
GC_bytes_allocd = 0;
+ GC_bytes_dropped = 0;
GC_bytes_freed = 0;
GC_finalizer_bytes_freed = 0;
word _bytes_allocd;
/* Number of words allocated during this collection cycle */
# endif
+ word _bytes_dropped;
+ /* Number of black-listed bytes dropped during GC cycle */
+ /* as a result of repeated scanning during allocation */
+ /* attempts. These are treated largely as allocated, */
+ /* even though they are not useful to the client. */
word _bytes_finalized;
/* Approximate number of bytes in objects (and headers) */
/* That became ready for finalization in the last */
# define GC_large_free_bytes GC_arrays._large_free_bytes
# define GC_large_allocd_bytes GC_arrays._large_allocd_bytes
# define GC_max_large_allocd_bytes GC_arrays._max_large_allocd_bytes
+# define GC_bytes_dropped GC_arrays._bytes_dropped
# define GC_bytes_finalized GC_arrays._bytes_finalized
# define GC_non_gc_bytes_at_gc GC_arrays._non_gc_bytes_at_gc
# define GC_bytes_freed GC_arrays._bytes_freed