NOMMU: stack versus malloc?

Bernhard Fischer rep.dot.nop at gmail.com
Tue Oct 9 19:41:22 UTC 2007


On Tue, Oct 09, 2007 at 02:56:49PM -0400, Mike Frysinger wrote:
>On Tuesday 09 October 2007, Denys Vlasenko wrote:
>> A question to people who work with NOMMU machines:
>>
>> Obviously, having small stack usage is important for
>> small, NOMMU machines.
>>
>> However, after a certain point you cannot just eliminate
>> stack usage, you must move it to other storage.
>>
>> For example, lineedit.c currently eats 12k+ if stack.
>>
>> I can convert it into malloc use.
>>
>> Question: is it better or actually worse?
>> Line editing is invoked repeatedly, and repeated malloc/free
>> of random-sized blocks can increase fragmentation
>> -> increase memory consumption.
>
>it really depends on the size of the consumption ... on nommu, the default 
>stack is 4k, so i'd say if you're talking about more than 1k, it should be a 
>malloc ...

AFAIK there was RESERVE_CONFIG_BUFFER for (potentially big) stack users.



More information about the busybox mailing list