From: Dominic Dunlop Date: Wed, 8 Jul 1998 11:21:48 +0000 (+0000) Subject: reenable misaligned memory checks, cast to UV & check alignment X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=802004fa6d912731c22aedfc387948d61f015eb9;p=p5sagit%2Fp5-mst-13.2.git reenable misaligned memory checks, cast to UV & check alignment Message-Id: Subject: Re: [PATCH 5.00469] corrupt malloc ptr on NeXT p4raw-id: //depot/perl@1389 --- diff --git a/malloc.c b/malloc.c index 377bc21..e52cc0d 100644 --- a/malloc.c +++ b/malloc.c @@ -735,8 +735,8 @@ malloc(register size_t nbytes) (long)size)); /* remove from linked list */ -#if defined(RCHECK) && !defined(USE_PERL_SBRK) - if (*((int*)p) & (sizeof(union overhead) - 1)) +#if defined(RCHECK) + if (((UV)p) & (MEM_ALIGNBYTES - 1)) PerlIO_printf(PerlIO_stderr(), "Corrupt malloc ptr 0x%lx at 0x%lx\n", (unsigned long)*((int*)p),(unsigned long)p); #endif