+2011-05-05 Ivan Maidanski <ivmai@mail.ru>
+
+ * dbg_mlc.c (GC_has_other_debug_info): Fix punctuation in the
+ comment.
+ * dbg_mlc.c (GC_FREED_MEM_MARKER): New macro.
+ * dbg_mlc.c (GC_debug_free): Use GC_FREED_MEM_MARKER.
+ * dbg_mlc.c (GC_smashed): Refine documentation.
+ * mark.c (GC_push_selected): Change dirty_fn return type to
+ GC_bool.
+ * os_dep.c (GC_page_was_ever_dirty): Make GC_INNER.
+ * reclaim.c (GC_reclaim_small_nonempty_block): Remove "kind"
+ local variable.
+ * reclaim.c (GC_reclaim_block): Pass true constant to
+ GC_reclaim_small_nonempty_block (instead of report_if_found).
+ * doc/README.autoconf: Update; fix a typo.
+ * include/private/gcconfig.h (GC_WORD_C): New macro.
+
2011-05-03 Ivan Maidanski <ivmai@mail.ru>
* dbg_mlc.c (GC_store_debug_info_inner): Cast "linenum".
GC_INNER void GC_default_print_heap_obj_proc(ptr_t p);
#ifndef SHORT_DBG_HDRS
- /* Check whether object with base pointer p has debugging info */
+ /* Check whether object with base pointer p has debugging info. */
/* p is assumed to point to a legitimate object in our part */
/* of the heap. */
/* This excludes the check as to whether the back pointer is */
}
#endif /* ATOMIC_UNCOLLECTABLE */
+#ifndef GC_FREED_MEM_MARKER
+# if CPP_WORDSZ == 32
+# define GC_FREED_MEM_MARKER 0xdeadbeef
+# else
+# define GC_FREED_MEM_MARKER GC_WORD_C(0xEFBEADDEdeadbeef)
+# endif
+#endif
+
GC_API void GC_CALL GC_debug_free(void * p)
{
ptr_t base;
size_t i;
size_t obj_sz = BYTES_TO_WORDS(hhdr -> hb_sz - sizeof(oh));
- for (i = 0; i < obj_sz; ++i) ((word *)p)[i] = 0xdeadbeef;
+ for (i = 0; i < obj_sz; ++i)
+ ((word *)p)[i] = GC_FREED_MEM_MARKER;
GC_ASSERT((word *)p + i == (word *)(base + hhdr -> hb_sz));
}
} /* !GC_find_leak */
#ifndef SHORT_DBG_HDRS
-/* List of smashed objects. We defer printing these, since we can't */
-/* always print them nicely with the allocation lock held. */
-/* We put them here instead of in GC_arrays, since it may be useful to */
-/* be able to look at them with the debugger. */
+/* List of smashed (clobbered) locations. We defer printing these, */
+/* since we can't always print them nicely with the allocation lock */
+/* held. We put them here instead of in GC_arrays, since it may be */
+/* useful to be able to look at them with the debugger. */
#ifndef MAX_SMASHED
# define MAX_SMASHED 20
#endif
-As of GC6.0alpha8, we attempt to support GNU-style builds based on automake,
+Starting from GC v6.0, we support GNU-style builds based on automake,
autoconf and libtool. This is based almost entirely on Tom Tromey's work
with gcj.
some, please let me know.)
Note that the distribution comes with a "Makefile" which will be overwritten
-by "configure" with one that is not at all equiavelent to the original. The
+by "configure" with one that is not at all equivalent to the original. The
distribution contains a copy of the original "Makefile" in "Makefile.direct".
Important options to configure:
--enable-threads=TYPE choose threading package
--enable-parallel-mark parallelize marking and free list construction
--enable-gc-debug (--enable-full-debug before about 7.0)
- include full support for pointer backtracing etc.
+ include full support for pointer back-tracing etc.
Unless --prefix is set (or --exec-prefix or one of the more obscure options),
/* strtoul() fits since sizeof(long) >= sizeof(word). */
# define STRTOULL strtoul
# endif
-#endif
+#endif /* !STRTOULL */
+
+#ifndef GC_WORD_C
+# if defined(_WIN64) && !defined(__GNUC__)
+# define GC_WORD_C(val) val##ui64
+# elif defined(_LLP64) || defined(__LLP64__) || defined(_WIN64)
+# define GC_WORD_C(val) val##ULL
+# else
+# define GC_WORD_C(val) ((word)val##UL)
+# endif
+#endif /* !GC_WORD_C */
#if defined(SPARC)
# define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */
* in the event of a stack overflow.)
*/
STATIC void GC_push_selected(ptr_t bottom, ptr_t top,
- int (*dirty_fn)(struct hblk *),
+ GC_bool (*dirty_fn)(struct hblk *),
void (*push_fn)(ptr_t, ptr_t))
{
struct hblk * h;
# ifdef CHECKSUMS
/* Could any valid GC heap pointer ever have been written to this page? */
/*ARGSUSED*/
- GC_bool GC_page_was_ever_dirty(struct hblk *h)
+ GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk *h)
{
/* FIXME - implement me. */
return(TRUE);
{
hdr *hhdr = HDR(hbp);
size_t sz = hhdr -> hb_sz;
- int kind = hhdr -> hb_obj_kind;
- struct obj_kind * ok = &GC_obj_kinds[kind];
+ struct obj_kind * ok = &GC_obj_kinds[hhdr -> hb_obj_kind];
void **flh = &(ok -> ok_freelist[BYTES_TO_GRANULES(sz)]);
hhdr -> hb_last_reclaimed = (unsigned short) GC_gc_no;
if (report_if_found) {
GC_reclaim_check(hbp, hhdr, sz);
} else {
- *flh = GC_reclaim_generic(hbp, hhdr, sz,
- ok -> ok_init,
+ *flh = GC_reclaim_generic(hbp, hhdr, sz, ok -> ok_init,
*flh, &GC_bytes_found);
}
}
GC_atomic_in_use += sz * hhdr -> hb_n_marks;
}
if (report_if_found) {
- GC_reclaim_small_nonempty_block(hbp, (GC_bool)report_if_found);
+ GC_reclaim_small_nonempty_block(hbp, TRUE /* report_if_found */);
} else if (empty) {
GC_bytes_found += HBLKSIZE;
GC_freehblk(hbp);