don't print any debug info about potentially invalid objects

This commit is contained in:
Alex Shinn 2011-02-09 23:45:25 +09:00
parent fa730ee28e
commit e455d7b2cb

6
gc.c
View file

@ -46,15 +46,13 @@ sexp_uint_t sexp_allocated_bytes (sexp ctx, sexp x) {
static int sexp_in_heap_p(sexp ctx, sexp x) { static int sexp_in_heap_p(sexp ctx, sexp x) {
sexp_heap h; sexp_heap h;
if ((sexp_uint_t)x & (sexp_heap_align(1)-1)) { if ((sexp_uint_t)x & (sexp_heap_align(1)-1)) {
fprintf(stderr, SEXP_BANNER("invalid heap alignment: %p %d"), fprintf(stderr, SEXP_BANNER("invalid heap alignment: %p"), x);
x, sexp_pointer_tag(x));
return 0; return 0;
} }
for (h=sexp_context_heap(ctx); h; h=h->next) for (h=sexp_context_heap(ctx); h; h=h->next)
if (((sexp)h < x) && (x < (sexp)(h->data + h->size))) if (((sexp)h < x) && (x < (sexp)(h->data + h->size)))
return 1; return 1;
fprintf(stderr, SEXP_BANNER("invalid object outside heap: %p %d"), fprintf(stderr, SEXP_BANNER("invalid object outside heap: %p"), x);
x, sexp_pointer_tag(x));
return 0; return 0;
} }
#else #else