[BusyBox] Malloc vs. BSS vs Stack???

Steven Scholz steven.scholz at imc-berlin.de
Sun Dec 8 10:29:03 UTC 2002


Hi there,

what are the real advantages/disadvantages of the three ways BusyBox can handle
buffer allocations?

The help text says:

There are 3 ways BusyBox can handle buffer allocations:
   - Use malloc. This costs code size for the call to xmalloc.                
   - Put them on stack. For some very small machines with limited stack       
     space, this can be deadly.  For most folks, this works just fine.        
   - Put them in BSS. This works beautifully for computers with a real        
     MMU (and OS support), but wastes runtime RAM for uCLinux. This           
     behavior was the only one available for BusyBox versions 0.48 and        
     earlier.                                                                 

Is xmalloc slower than BSS? 
What about stack? What means "very small machines with limited stack"?
What's the advantage of using the stack?

(Let's say I am using MPC8xx powerpc systems with a real MMU...)

Thanks a million!

Steven



More information about the busybox mailing list