summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1998-11-06 08:05:31 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1998-11-06 08:05:31 +0000
commitacc3bde0c1cc7602c674eca404394646c15d87f1 (patch)
tree24274b89b61b83653b0585000e008268fcd27437 /malloc.c
parentbdd6696892b57e3fa93fc4ddc3f9440809bbac50 (diff)
downloadperl-acc3bde0c1cc7602c674eca404394646c15d87f1.tar.gz
Renamed malloc.c ASSERT() macro to P_ASSERT() because
ASSERT() causes problems in {NeXTStep,OpenStep}. From: Hans Mulder <hansm@icgroup.nl> To: Jarkko Hietaniemi <jhi@cc.hut.fi> Subject: Re: Not OK: perl 5.00553 on OPENSTEP-Mach 4_1 (UNINSTALLED) Date: Fri, 6 Nov 98 01:27:41 +0100 Message-Id: <9811060025.AA27389@icgned.icgroup.nl> and From: Ilya Zakharevich <ilya@math.ohio-state.edu> Subject: Re: ASSERT() in malloc.c To: jhi@iki.fi Date: Fri, 6 Nov 1998 02:59:29 -0500 (EST) Message-Id: <199811060759.CAA18915@monk.mps.ohio-state.edu> p4raw-id: //depot/cfgperl@2209
Diffstat (limited to 'malloc.c')
-rw-r--r--malloc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/malloc.c b/malloc.c
index 13f20ff1db..65cddbee83 100644
--- a/malloc.c
+++ b/malloc.c
@@ -670,7 +670,7 @@ static u_int start_slack;
static u_int goodsbrk;
#ifdef DEBUGGING
-#define ASSERT(p,diag) if (!(p)) botch(diag,STRINGIFY(p)); else
+#define P_ASSERT(p,diag) if (!(p)) botch(diag,STRINGIFY(p)); else
static void
botch(char *diag, char *s)
{
@@ -678,7 +678,7 @@ botch(char *diag, char *s)
PerlProc_abort();
}
#else
-#define ASSERT(p, diag)
+#define P_ASSERT(p, diag)
#endif
Malloc_t
@@ -1219,7 +1219,7 @@ free(void *mp)
}
MUTEX_LOCK(&PL_malloc_mutex);
#ifdef RCHECK
- ASSERT(ovp->ov_rmagic == RMAGIC, "chunk's head overwrite");
+ P_ASSERT(ovp->ov_rmagic == RMAGIC, "chunk's head overwrite");
if (OV_INDEX(ovp) <= MAX_SHORT_BUCKET) {
int i;
MEM_SIZE nbytes = ovp->ov_size + 1;
@@ -1227,16 +1227,16 @@ free(void *mp)
if ((i = nbytes & 3)) {
i = 4 - i;
while (i--) {
- ASSERT(*((char *)((caddr_t)ovp + nbytes - RSLOP + i))
+ P_ASSERT(*((char *)((caddr_t)ovp + nbytes - RSLOP + i))
== RMAGIC_C, "chunk's tail overwrite");
}
}
nbytes = (nbytes + 3) &~ 3;
- ASSERT(*(u_int *)((caddr_t)ovp + nbytes - RSLOP) == RMAGIC, "chunk's tail overwrite");
+ P_ASSERT(*(u_int *)((caddr_t)ovp + nbytes - RSLOP) == RMAGIC, "chunk's tail overwrite");
}
ovp->ov_rmagic = RMAGIC - 1;
#endif
- ASSERT(OV_INDEX(ovp) < NBUCKETS, "chunk's head overwrite");
+ P_ASSERT(OV_INDEX(ovp) < NBUCKETS, "chunk's head overwrite");
size = OV_INDEX(ovp);
ovp->ov_next = nextf[size];
nextf[size] = ovp;
@@ -1352,11 +1352,11 @@ realloc(void *mp, size_t nbytes)
if ((i = nb & 3)) {
i = 4 - i;
while (i--) {
- ASSERT(*((char *)((caddr_t)ovp + nb - RSLOP + i)) == RMAGIC_C, "chunk's tail overwrite");
+ P_ASSERT(*((char *)((caddr_t)ovp + nb - RSLOP + i)) == RMAGIC_C, "chunk's tail overwrite");
}
}
nb = (nb + 3) &~ 3;
- ASSERT(*(u_int *)((caddr_t)ovp + nb - RSLOP) == RMAGIC, "chunk's tail overwrite");
+ P_ASSERT(*(u_int *)((caddr_t)ovp + nb - RSLOP) == RMAGIC, "chunk's tail overwrite");
/*
* Convert amount of memory requested into
* closest block size stored in hash buckets