[En-Nut-Discussion] Extending printf for handling 64 bit values
Harald Kipp
harald.kipp at egnite.de
Mon Sep 23 16:44:24 CEST 2013
Hi list,
I'm sure, that many developers wants to have this and it's great that
Uwe implemented it and tested it on the Cortex.
But there's a big problem with the current implementation.
This simple program
#include <dev/board.h>
#include <dev/debug.h>
#include <sys/heap.h>
#include <stdio.h>
int main(void)
{
NutRegisterDevice(&devDebug0, 0, 0);
freopen("uart0", "w", stdout);
printf("%d bytes free\n", NutHeapAvailable());
for (;;);
}
creates an AVR 8-bit binary of 6804 bytes and consumes 2020 bytes of
RAM. That's already an awful lot.
When adding Uwe's 64-bit patch, the binary grows by another 748 bytes
and consumes an additional 36 bytes of RAM. Even if you don't need
64-bit values. I think this is too costly.
When adding a new function, which consumes significantly more resources
without actually using it, user should have to ability to disable this
new feature via the Configurator.
Regards,
Harald
More information about the En-Nut-Discussion
mailing list