From 990e7a67da8fbbafaff3f431d66dde102decfd34 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 31 Jul 1989 12:55:33 +0000 Subject: [PATCH] Added some assertions --- modules/src/malloc/mal.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/src/malloc/mal.c b/modules/src/malloc/mal.c index e3309102d..29ad660f5 100644 --- a/modules/src/malloc/mal.c +++ b/modules/src/malloc/mal.c @@ -49,6 +49,7 @@ malloc(n) *stp = log_next_of(ml); set_store(ml, 0); check_mallinks("malloc fast exit"); + assert(! in_store(ml)); return block_of_mallink(ml); } } @@ -139,6 +140,9 @@ malloc(n) stopped_working_on(ml); check_mallinks("malloc exit"); check_work_empty("malloc exit"); +#ifdef STORE + assert(! in_store(ml)); +#endif return block_of_mallink(ml); }} @@ -273,6 +277,9 @@ realloc(addr, n) while (size--) *l1++ = *l2++; free(addr); check_work_empty("mv_realloc"); +#ifdef STORE + assert(! in_store(new)); +#endif return new; } /* it helped, but maybe too well */ @@ -283,6 +290,9 @@ realloc(addr, n) stopped_working_on(ml); check_mallinks("realloc exit"); check_work_empty("realloc"); +#ifdef STORE + assert(! in_store(ml)); +#endif return addr; }}