Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Re: Doug Lea's malloc adapted for 64bit, needs testing [w/ fix]
       [not found] <199606072205.PAA01642@koala.azstarnet.com>
@ 1996-06-08 15:43 ` Wolfram Gloger
  0 siblings, 0 replies; only message in thread
From: Wolfram Gloger @ 1996-06-08 15:43 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-06-08 15:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <199606072205.PAA01642@koala.azstarnet.com>
1996-06-08 15:43 ` Doug Lea's malloc adapted for 64bit, needs testing [w/ fix] Wolfram Gloger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox