This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Stack usage measurement


Szentirmai Gergely wrote:
> Does anybody has a estimation about the stack usage of pintf stuff? [...]
> As a summary, I would have to avoid the usage of any printf if I'm short
> of memory?

printf (or, more precisely, the actual format conversion in vfnprintf) is
really quite a complicated function. This regularly bites people on limited
targets; sometimes simply using printf is enough to cause your application
to fail to link because it won't fit into RAM.

If you don't need to print out floating point numbers, you might save a
little code size by disabling that support in your eCos config. Otherwise,
puts and putc are pretty lean and mean - you could save a lot of code and
stack if you can avoid printf in your application.


Ross

-- 
Embedded Software Engineer, eCosCentric Limited.
Barnwell House, Barnwell Drive, Cambridge CB5 8UU, UK.
Registered in England no. 4422071.                  www.ecoscentric.com

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]