Forum Discussion
Altera_Forum
Honored Contributor
19 years ago --- Quote Start --- originally posted by ikuo005@Jul 17 2006, 07:54 PM thanks for your reply, slacker http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/smile.gif
as i don't have very clear concept as to what kind of stuff are stored in heap &stack memory. i didn't know where to look for to get an idea how much i might need to allocate for them. is it the registers that i should be looking at?? --- Quote End --- This is something that must be determined at run time. You cannot determine it statically... <div class='quotetop'>QUOTE </div> --- Quote Start --- When i was compiling my c files, the following info was printed to the console in NIOS II IDE, does this suggest the size that are estimated to be needed for heap and stack at the compilation time? Info: (four_regs_write.elf) 175 KBytes program size (code + initialized data). Info: 16208 KBytes free for stack + heap.[/b] --- Quote End --- This is telling you how much free space you have for the stack and the heap, combined. The heap starts from the bottom and increments and the stack starts from the top and decrements. Eventually, depending on how your code runs, they can collide. You can reduce your code's memory footprint in several ways. These methods are mentioned, inline, in several of the software example templates (hello world small comes to mind, though I think hello led has something as well) Cheers, - slacker