Function RAM usage and struct size
-
Is there any way to know the size of a structure? typedef struct { ... }struct;
And the RAM usage for a function?I have looking in the -Wl, ... map file but I can't find what I want.
Thanks.
-
"sizeof()":http://en.wikipedia.org/wiki/Sizeof for the structure.
Not sure how you mean by the RAM usage for a function.
-
But sizeof only works in run time (I need to run the program to output the size of the structs).
I think I need some debug information (generated by debug), because I can see the size of structs while in debug window.Also, I found this useful flag:
QMAKE_CXXFLAGS += -fstack-usageit outputs the stack usage of each function.
-
You didn't mention that run time wasn't what you were looking for. ;)
What do you need the information for? (Just curious.)
-
I'm developing a framework for help the develop of embedded systems that use QT for pre-development/deploy.
http://code.ua.pt/projects/truefessim/wiki
Its useful to know some statistics of how much memory I need for structures.
In microcontrollers it isn't much memory: from 128bytes.. up to 4 .. 8K RAM...