Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHow to get current heap pointer?
My project need to read current heap pointer, but I don't know how to implement it. In NiosII IDE, Variables Window, you can add a global variables for watching, and I find heap_end which is...
Altera_Forum
Honored Contributor
20 years agoHi David_Cai,
I've looked some more at this problem. The symbol 'heap_end' is defined in nios2_60\bin\nios2-gnutools\src\newlib\libgloss\nios2\nosys_sbrk. It's definition is 'static char *heap_end;' A static symbol is only visible (for the toolchain) in the current file. If you generate an objdump listing of your executable you can see that heap_end is listed as a local symbol. So, if you try to reference this symbol in another file, it's the same as it wasn't defined at all. => >>undefined reference to `heap_end'<< Hope this helps, Wolfgang