summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorLarry Wall <larry@netlabs.com>1994-03-18 00:00:00 +0000
committerLarry Wall <larry@netlabs.com>1994-03-18 00:00:00 +0000
commit8990e3071044a96302560bbdb5706f3e74cf1bef (patch)
tree6cf4a58108544204591f25bd2d4f1801d49334b4 /malloc.c
parented6116ce9b9d13712ea252ee248b0400653db7f9 (diff)
downloadperl-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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/malloc.c b/malloc.c
index 3e940f4050..41a5d7802d 100644
--- a/malloc.c
+++ b/malloc.c
@@ -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;