Where and how much memory can I allocated?

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

Where and how much memory can I allocated?

Postby eliecer » Tue Dec 30, 2014 1:04 am

Hi,

When I use the function malloc in the cores, where does it allocates memory? In the Epiphany Architecture Reference there is a picture where I can see the banks 0, 1, 2 and 3, reserved memory and memory mapped registers in each core. Where does it allocates memory? And how much memory can I allocated?

I have a problem with my app and I think that it is for the allocated memory.

Thank you
User avatar
eliecer
 
Posts: 25
Joined: Fri Sep 26, 2014 1:20 am
Location: Málaga, Spain

Re: Where and how much memory can I allocated?

Postby aolofsson » Wed Dec 31, 2014 1:40 pm

Are you trying to run standard "malloc" from within a core? The quick recommendation is, don't...can you say more about what you are trying to do?
Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Where and how much memory can I allocated?

Postby eliecer » Wed Dec 31, 2014 2:36 pm

I try to used a function of other person. I have modified the function, now it don't need to do malloc.

But... I am interested in to know where and how much memory can I to allocate.

Thank you Andreas.
User avatar
eliecer
 
Posts: 25
Joined: Fri Sep 26, 2014 1:20 am
Location: Málaga, Spain

Re: Where and how much memory can I allocated?

Postby sebraa » Mon Jan 05, 2015 3:38 pm

The default linker scripts (I checked fast.ldf) define a 512 KB heap for each core, located in the upper half of shared memory, starting from 0x8f000000 + 512K*CORE_NUM. So if you use malloc(), you get memory from there.

Everything else you have to allocate manually.
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 10 guests

cron