[BusyBox] choice for reserving buffers

Vladimir N. Oleynik dzo at simtreas.ru
Sat Jan 27 16:53:30 UTC 2001


Tomi Ollila wrote:

> I╢d rather go with "pre-paid" small stack than a larger one and then
> allocate from heap when necessary to get more. This way the applets
> that doesn╢t require so much memory doesn╢t need to "pay" for the
> stack they doesn╢t need. If there are many concurrent processes all
> having big stacks the memory may be eaten out pretty quick... 
> I remember Amiga OS used to have default stack size per process
> something like 4K in the early times and that machine sure could run
> dozens of processes concurrently if needed...

I on Xenix-286 used other method:

1) Renamed names buffers in neutral names
2) Parsed the code on a maximum quantity of different buffers
3) Also created necessary quantity of buffers in BSS, 
involving macros

Bonus: It is possible to not transfer additional parameters to the
function as the buffer become global, instead of in the stack. 

And the stack on Xenix-286 was strongly limited.


--w
vodz





More information about the busybox mailing list