Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

malloc problem

HI,

I want to know how do i allocate a specific amount of memory in specific places.. like SDRAM or SRAM? where my .heap is somewhere else?

Thank you.

Michael

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    malloc() allocates in .heap, so check in BSP properties where the .heap is placed. The size of allocated space is determined in malloc() function parameters.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    malloc() allocates in .heap, so check in BSP properties where the .heap is placed. The size of allocated space is determined in malloc() function parameters.

    --- Quote End ---

    Yes i know malloc() will allocate memory in heap. Sorry, i did not make it clear. what i was asking is that, how can i use other command to allocate memory in non heap location.

    Michael