summaryrefslogtreecommitdiff
path: root/allchblk.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2009-06-12 01:07:43 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:45 +0200
commit62b4cd13a0e2e324c641f4c80546f95cc20e9996 (patch)
tree040618524a2f16cffaae46a49a1b0126550d0a5c /allchblk.c
parent686e786031b6d289bb20af32cc57ec3208185237 (diff)
2009-06-11 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff92_cvs: resembling diff20, diff27, diff34, diff38, diff43, diff45, diff46, diff56, diff60, diff62, diff74, diff75, diff81 partly) * allchblk.c (GC_print_hblkfreelist, GC_dump_regions): Convert a group of printf() calls into a single one (for output atomicity). * include/gc.h (GC_set_all_interior_pointers, GC_set_full_freq, GC_set_time_limit): New prototypes. * misc.c (GC_set_all_interior_pointers, GC_set_full_freq, GC_set_time_limit): New public setter/getter functions. * include/gc.h: Fix (and remove outdated) comments for thread-local allocation. * include/gc.h: Fix typos in comments. * misc.c (GC_init_inner, GC_printf): Ditto. * include/gc.h (GC_unregister_disappearing_link): Refine comment. * include/gc.h (GC_stack_base): Recognize _M_IA64 macro. * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset, DEGRADE_RATE): Define only if THREADS. * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset): Define as STATIC. * misc.c (GC_get_heap_size, GC_get_free_bytes, GC_get_bytes_since_gc, GC_get_total_bytes): Acquire the GC lock to avoid data races. * misc.c (GC_write_cs): Define only if THREADS (Win32/WinCE only). * misc.c (GC_init_inner): Initialize GC_write_cs only if THREADS. * misc.c (GC_init_inner): Use GC_INITIAL_HEAP_SIZE (if available) to set the default initial value of initial_heap_sz. * misc.c (GC_deinit): Destroy GC_write_cs only if THREADS. * misc.c (GC_init_inner): Fix WARN() format specifier (should be word-complient, "%p" is used w/o "0x"). * misc.c (GC_init_inner): Don't recognize "GC_PAUSE_TIME_TARGET" environment variable if SMALL_CONFIG. * misc.c (GC_init_inner): Recognize "GC_FULL_FREQUENCY" environment variable to set initial GC_full_freq value (if not SMALL_CONFIG). * doc/README.environment (GC_FULL_FREQUENCY): Add information. * doc/README.environment (GC_MARKERS): Refine information. * misc.c (GC_init_inner): Change GC_ASSERT to GC_STATIC_ASSERT where possible. * misc.c (IF_NEED_TO_LOCK): New macro (instead of GC_need_to_lock). * misc.c (GC_write): Use IF_NEED_TO_LOCK for handling GC_write_cs. * misc.c (GC_abort): Don't define if SMALL_CONFIG. * misc.c (GC_abort): Directly use WRITE() instead of GC_err_printf() (to prevent possible infinite recursion).
Diffstat (limited to 'allchblk.c')
-rw-r--r--allchblk.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/allchblk.c b/allchblk.c
index 694e9de..946f971 100644
--- a/allchblk.c
+++ b/allchblk.c
@@ -113,24 +113,19 @@ void GC_print_hblkfreelist(void)
for (i = 0; i <= N_HBLK_FLS; ++i) {
h = GC_hblkfreelist[i];
# ifdef USE_MUNMAP
- if (0 != h) GC_printf("Free list %ld:\n",
- (unsigned long)i);
+ if (0 != h) GC_printf("Free list %u:\n", i);
# else
- if (0 != h) GC_printf("Free list %lu (Total size %lu):\n",
- (long)i, (unsigned long)GC_free_bytes[i]);
+ if (0 != h) GC_printf("Free list %u (Total size %lu):\n",
+ i, (unsigned long)GC_free_bytes[i]);
# endif
while (h != 0) {
hhdr = HDR(h);
sz = hhdr -> hb_sz;
- GC_printf("\t%p size %lu ", h, (unsigned long)sz);
total_free += sz;
- if (GC_is_black_listed(h, HBLKSIZE) != 0) {
- GC_printf("start black listed\n");
- } else if (GC_is_black_listed(h, hhdr -> hb_sz) != 0) {
- GC_printf("partially black listed\n");
- } else {
- GC_printf("not black listed\n");
- }
+ GC_printf("\t%p size %lu %s black listed\n", h, (unsigned long)sz,
+ GC_is_black_listed(h, HBLKSIZE) != 0 ? "start" :
+ GC_is_black_listed(h, hhdr -> hb_sz) != 0 ? "partially" :
+ "not");
h = hhdr -> hb_next;
}
}
@@ -181,9 +176,8 @@ void GC_dump_regions(void)
GC_printf("***Section from %p to %p\n", start, end);
for (p = start; p < end;) {
hhdr = HDR(p);
- GC_printf("\t%p ", p);
if (IS_FORWARDING_ADDR_OR_NIL(hhdr)) {
- GC_printf("Missing header!!(%p)\n", hhdr);
+ GC_printf("\t%p Missing header!!(%p)\n", p, hhdr);
p += HBLKSIZE;
continue;
}
@@ -192,13 +186,9 @@ void GC_dump_regions(void)
divHBLKSZ(hhdr -> hb_sz));
int actual_index;
- GC_printf("\tfree block of size 0x%lx bytes",
- (unsigned long)(hhdr -> hb_sz));
- if (IS_MAPPED(hhdr)) {
- GC_printf("\n");
- } else {
- GC_printf("(unmapped)\n");
- }
+ GC_printf("\t%p\tfree block of size 0x%lx bytes%s\n", p,
+ (unsigned long)(hhdr -> hb_sz),
+ IS_MAPPED(hhdr) ? "" : " (unmapped)");
actual_index = free_list_index_of(hhdr);
if (-1 == actual_index) {
GC_printf("\t\tBlock not on free list %d!!\n",
@@ -209,7 +199,7 @@ void GC_dump_regions(void)
}
p += hhdr -> hb_sz;
} else {
- GC_printf("\tused for blocks of size 0x%lx bytes\n",
+ GC_printf("\t%p\tused for blocks of size 0x%lx bytes\n", p,
(unsigned long)(hhdr -> hb_sz));
p += HBLKSIZE * OBJ_SZ_TO_BLOCKS(hhdr -> hb_sz);
}