From 4a8044ce718c8db3192c9013ea32a5eeee2df8a0 Mon Sep 17 00:00:00 2001 From: Thiemo Seufer Date: Sun, 4 Dec 2005 22:52:40 +0000 Subject: [PATCH] 0.9.7.13: Implement gc_assert_verbose, and use it in a few cases. --- src/runtime/gc-common.c | 6 ++++-- src/runtime/gc-internal.h | 20 +++++++++++++++----- version.lisp-expr | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/runtime/gc-common.c b/src/runtime/gc-common.c index 069d501..0869cd9 100644 --- a/src/runtime/gc-common.c +++ b/src/runtime/gc-common.c @@ -187,7 +187,8 @@ scavenge(lispobj *start, long n_words) (scavtab[widetag_of(object)])(object_ptr, object); } } - gc_assert(object_ptr == end); + gc_assert_verbose(object_ptr == end, "Final object pointer %p, end %p\n", + object_ptr, end); } static lispobj trans_fun_header(lispobj object); /* forward decls */ @@ -344,7 +345,8 @@ scav_code_header(lispobj *where, lispobj object) entry_point != NIL; entry_point = function_ptr->next) { - gc_assert(is_lisp_pointer(entry_point)); + gc_assert_verbose(is_lisp_pointer(entry_point), "Entry point %lx\n", + (long)entry_point); function_ptr = (struct simple_fun *) native_pointer(entry_point); gc_assert(widetag_of(function_ptr->header)==SIMPLE_FUN_HEADER_WIDETAG); diff --git a/src/runtime/gc-internal.h b/src/runtime/gc-internal.h index d85a783..f04bf6e 100644 --- a/src/runtime/gc-internal.h +++ b/src/runtime/gc-internal.h @@ -19,14 +19,24 @@ /* disabling gc assertions made no discernable difference to GC speed, * last I tried it - dan 2003.12.21 */ #if 1 -#define gc_assert(ex) do { \ - if (!(ex)) gc_abort(); \ +# define gc_assert(ex) \ +do { \ + if (!(ex)) gc_abort(); \ +} while (0) +# define gc_assert_verbose(ex, fmt, ...) \ +do { \ + if (!(ex)) { \ + fprintf(stderr, fmt, ## __VA_ARGS__); \ + gc_abort(); \ + } \ } while (0) #else -#define gc_assert(ex) +# define gc_assert(ex) +# define gc_assert_verbose(ex, fmt, ...) #endif -#define gc_abort() lose("GC invariant lost, file \"%s\", line %d", \ - __FILE__, __LINE__) + +#define gc_abort() \ + lose("GC invariant lost, file \"%s\", line %d\n", __FILE__, __LINE__) #define CEILING(x,y) (((x) + ((y) - 1)) & (~((y) - 1))) diff --git a/version.lisp-expr b/version.lisp-expr index 0b15317..7312551 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.7.12" +"0.9.7.13" -- 1.7.10.4