From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199606081543.RAA13688@md.dent.med.uni-muenchen.de> Date: Sat, 8 Jun 1996 17:43:19 +0200 From: Wolfram Gloger Subject: Re: Doug Lea's malloc adapted for 64bit, needs testing [w/ fix] In-Reply-To: <199606072205.PAA01642@koala.azstarnet.com> Hi, I think I've found the problem you reported (I didn't realize size_t was unsigned 64bit on the Alpha). The fix for the version most people have downloaded is: --- malloc-64.c~ Sat Jun 8 14:31:04 1996 +++ malloc-64.c Sat Jun 8 17:16:49 1996 @@ -1138,7 +1138,7 @@ /* bin<->block macros */ -#define idx2binblock(ix) (1 << (ix / BINBLOCKWIDTH)) +#define idx2binblock(ix) ((size_t)1 << (ix / BINBLOCKWIDTH)) #define mark_binblock(ii) (binblocks |= idx2binblock(ii)) #define clear_binblock(ii) (binblocks &= ~(idx2binblock(ii))) (I have also corrected this in the anon. ftp directory.) Many thanks to Marvin Wu who provided me with a test account on an Alpha system ! It should work fine now on 64bit, but due to the 8-byte size_t all allocations of less than 32byte will occupy a full 32byte chunk. In practice, this may be intolerable. Doug Lea mentioned plans to handle such very small chunks specially -- maybe something will be hacked in over the summer. Regards, Wolfram.