Subject: Re: libsa/alloc.c 'freelist' initialization
To: None <firstname.lastname@example.org>
From: Chris G. Demetriou <email@example.com>
Date: 05/10/1999 16:31:01
Simon Burge <firstname.lastname@example.org> writes:
> Sounds like a good call to me. I don't suppose egcs is smart enough to
> move variables initialised to 0 to the BSS?
Err, uh, that'd actually be Smart, not smart.
Often the point of initializing a variable to 0 is just so that you
can patch it later.
The compiler _shouldn't even think about_ trying that, unless it's
> FWIW, I'm sitting on an alloc that's basically:
> void *
> void *old;
> static top = end;
> old = top
> top += size;
> with no implementation of free(). I was using this then the first stage
> pmax bootblocks didn't fit into 7.5k when we first changed from gcc to
> egcs. There was less than half a dozen calls to alloc() totalling less
> than 30kB.
Hmm. That could be a useful hack, but nobody seems to be screaming
for it right now. 8-)
Your code is a tiny bit broken, though: to work on all archs, it
should do the right things to make sure allocated blocks are aligned. 8-)
Chris Demetriou - email@example.com - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.