reenable misaligned memory checks, cast to UV & check alignment
Dominic Dunlop [Wed, 8 Jul 1998 11:21:48 +0000 (11:21 +0000)]
Message-Id: <v03110703b1c8ffdb68ed@[195.95.102.91]>
Subject: Re: [PATCH 5.00469] corrupt malloc ptr on NeXT

p4raw-id: //depot/perl@1389

malloc.c

index 377bc21..e52cc0d 100644 (file)
--- 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