Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

the function malloc( )

Altera_Forum
Honored Contributor II
1,084 Views

hello  

 

 

Now ,I know the function malloc() can be used to build a dynamic memory .But I am not sure that 

the dynamic memory takes up the onchiop memory if I only use the onchip memory not the periphery sram. 

where the dynamic memory is in ,onchip memory or periphery sram ? 

 

 

 

 

 

 

Thank you !
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
360 Views

The memory space which malloc() allocated memory from is called the heap. 

 

By default this is located immediately after your BSS section (which goes in the memory specified as rwdata in the GUI) and continues until it gets to the end of the memory or until it reaches the stack. 

 

If you want more information then please look in the altera_hal source code for the the function sbrk() which is what malloc() uses to get more memory to allocate.
0 Kudos
Reply