[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - malloc

malloc

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

malloc

Postby Albert Netymk » Mon Apr 08, 2013 2:13 pm

Is it possible to use malloc on Epiphany architecture? If so, is there any small examples?
Albert Netymk
 
Posts: 4
Joined: Thu Mar 21, 2013 3:21 pm

Re: malloc

Postby ysapir » Mon Apr 08, 2013 11:27 pm

Albert
You can definitely use malloc(), like any other standard library function. However, using the malloc() function, *printf() and a few more that rely on dynamic memory management, will most probably not fit into the code space in the core. It is then necessary to use the fast.ldf linker script for placing libc calls in external mem, or legacy.ldf, for placing all code in external mem.

Also make sure that the heap, defined in the LDF, is where you think it is.
User avatar
ysapir
 
Posts: 393
Joined: Tue Dec 11, 2012 7:05 pm

Re: malloc

Postby Albert Netymk » Fri Apr 12, 2013 6:36 pm

Thank ysapir for the quick reply. Inspired by your explanation, I reviewed the sdk manual to confirm that all three linker files (legacy, fast and internal) don't place heap into the 32k SRAM inside each other. For high performance applications, it's tricky to manage memory efficiently. Therefore, it's beter just stick with static variables.

One reminder, though, is the address operator '&' only returns the local address if this variable is in internal SRAM, and I had to call e_xxx apis to convert it to global ones manually. Not sure, if there's any overhead using global address in the own core.
Albert Netymk
 
Posts: 4
Joined: Thu Mar 21, 2013 3:21 pm

Re: malloc

Postby ysapir » Fri Apr 12, 2013 6:51 pm

Using local space pointers should be considered a preferred practice where possible, b/c global pointers go through the mesh node router on their way back to the local memory. In some abnormal and very rare situations, this may cause program instability.
User avatar
ysapir
 
Posts: 393
Joined: Tue Dec 11, 2012 7:05 pm

Re: malloc

Postby Albert Netymk » Sun Apr 14, 2013 8:56 pm

It's not very surprising that there's indeed some overhead using global addresses. In chapter 5 eMeshTM Network-On-Chip of Epiphay architecture, it mentioned something like routing. Where could I find any documented proof that the overhead exists? (Need it for my scientific paper.)
Albert Netymk
 
Posts: 4
Joined: Thu Mar 21, 2013 3:21 pm

Re: malloc

Postby notzed » Sat May 18, 2013 6:32 am

It's possible to write a very small dynamic memory implementation that would fit quite easily. With such a limited space it may be difficult to make use of it though.
notzed
 
Posts: 331
Joined: Mon Dec 17, 2012 12:28 am
Location: Australia

Re: malloc

Postby CIB » Mon Aug 05, 2013 8:03 pm

*casts thread necromancy*

Thank you, exactly the info I needed. With such limited memory, but high in-chip bandwidth, maybe a more naive memory management approach, e.g. using bitmaps, would be efficient?
CIB
 
Posts: 108
Joined: Sat Jul 13, 2013 1:57 pm

Re: malloc

Postby Gravis » Mon Aug 05, 2013 9:16 pm

User avatar
Gravis
 
Posts: 445
Joined: Mon Dec 17, 2012 3:27 am
Location: East coast USA.

Re: malloc

Postby CIB » Mon Aug 05, 2013 9:35 pm

CIB
 
Posts: 108
Joined: Sat Jul 13, 2013 1:57 pm

Re: malloc

Postby LamsonNguyen » Tue Aug 06, 2013 3:59 am

How to be creative when faced with limitations......now where have I heard of that before........?
LamsonNguyen
 
Posts: 138
Joined: Sun Dec 16, 2012 7:09 pm


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 54 guests