Hi Will,

> If you don't have alloca, and you don't want to use assembler, and you
> don't want the overhead of malloc/free, and you don't want to, or literally
> can't, risk "demons flying out of your nose":
> 
> typedef char byte;
> byte hack[HACK_SIZE];  // "hack" is meant to remind one of "stack"
> byte * hack_ptr = hack+(HACK_SIZE-1);
> void * hack_alloc(size_t num_bytes) {
> ...

Well, nice try, but it is not helpful here.

Basically you are implementing you own malloc(), which is still far away
from a single-instruction push, pop or stack arithmetic.

And it is worse than that, because it violates the "Unlimited" principle
even more, with the constant HACK_SIZE. If you make 'hack' variably
sized (allocated by malloc() or realloc() again?), you get a full blown
self-made memory manager. So why the trouble? :)

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to