diff options
author | Larry Wall <larry@netlabs.com> | 1994-03-18 00:00:00 +0000 |
---|---|---|
committer | Larry Wall <larry@netlabs.com> | 1994-03-18 00:00:00 +0000 |
commit | 8990e3071044a96302560bbdb5706f3e74cf1bef (patch) | |
tree | 6cf4a58108544204591f25bd2d4f1801d49334b4 /malloc.c | |
parent | ed6116ce9b9d13712ea252ee248b0400653db7f9 (diff) | |
download | perl-8990e3071044a96302560bbdb5706f3e74cf1bef.tar.gz |
perl 5.0 alpha 6
[editor's note: cleaned up from the September '94 InfoMagic CD, just
like the last commit]
Diffstat (limited to 'malloc.c')
-rw-r--r-- | malloc.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -82,7 +82,6 @@ union overhead { }; #define MAGIC 0xff /* magic # on accounting info */ -#define OLDMAGIC 0x7f /* same after a free() */ #define RMAGIC 0x55555555 /* magic # on range info */ #ifdef RCHECK #define RSLOP sizeof (u_int) @@ -303,16 +302,20 @@ free(mp) ASSERT(op->ov_magic == MAGIC); /* make sure it was in use */ #else if (op->ov_magic != MAGIC) { +#ifdef RCHECK warn("%s free() ignored", - op->ov_magic == OLDMAGIC ? "Duplicate" : "Bad"); + op->ov_rmagic == RMAGIC - 1 ? "Duplicate" : "Bad"); +#else + warn("Bad free() ignored"); +#endif return; /* sanity */ } - op->ov_magic = OLDMAGIC; #endif #ifdef RCHECK ASSERT(op->ov_rmagic == RMAGIC); if (op->ov_index <= 13) ASSERT(*(u_int *)((caddr_t)op + op->ov_size + 1 - RSLOP) == RMAGIC); + op->ov_rmagic = RMAGIC - 1; #endif ASSERT(op->ov_index < NBUCKETS); size = op->ov_index; |