This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: stdio vs. diag_printf
- To: Grant Edwards <grante at visi dot com>
- Subject: RE: [ECOS] stdio vs. diag_printf
- From: Gary Thomas <gthomas at redhat dot com>
- Date: Mon, 10 Jul 2000 16:06:19 -0600 (MDT)
- Cc: ecos-discuss at sourceware dot cygnus dot com
On 11-Jul-2000 Grant Edwards wrote:
>
> Hi all,
>
> I'm looking for ways to trim memory usage and am trying to
> figure out how much of the stdio stuff I really need. All I
> really want is unbuffered output to the diagnostic port
> supporting non-floating point "printf" formats.
>
> Right now, debugging stuff is a mixture of printf() and
> diag_printf(). If I change all of the debugging stuff to
> diag_printf, can I loose some more library stuff?
>
> IOW, does diag_printf require the stdio package? If not, I
> think this would, in turn, allow me to get rid of malloc() and
> its associated heap and posssibly some other stuff.
>
'diag_printf()' does not use any of the [standard] C library stuff.
In fact, you can use it with only the HAL enabled and no other packages.
Yes, taking out your use of "printf()" and friends can provide a
significant memory savings.