Page 1 of 1
Peristent vars
Posted: 16 April 2008, 15:53 PM
by pjc30943
After compiling, 32 bytes of peristent memory is used--but I haven't declared any persistent variables.
Where do these bytes arise from?
EDIT: compiled for a 1280n
Posted: 16 April 2008, 16:20 PM
by mikep
The first 32 bytes of persistent memory (chip EEPROM) is reserved by the VM or ZX library. It contains things like the FirstTime flag.
The 32 bytes is not reported by the VM compiler as it already is reserved by the VM. It is reported by the native mode compiler because GCC (avr-size) reports the total memory used for each memory type. Potentially I guess Don could subtract 32 from the persistent memory number so that the compiler results are the same for VM and native mode devices.
Re: Peristent vars
Posted: 16 April 2008, 16:38 PM
by dkinzer
pjc30943 wrote:Where do these bytes arise from?
Those are the 32 bytes of Persistent Memory that are reserved for system use. At one time, we were planning to report only the number of bytes of Persistent Memory used by the application. We decided not to do so because we could not report RAM and Program Memory in the same way. The reason we cannot do so for those is because the contribution to RAM and Program Memory use from non-user sources varies depending on which System Library routines are used in a particular application. Moreover, the system and user items are intermixed in the memory spaces (other than Persistent Memory).
If you add the --keep-files option to your project file, you'll find a symbol file produced by the linker that will help you see which elements are from your program; all of them will have name that begin with a prefix like zf_, zv_. All other elements are system elements.