Page 1 of 1

Source to memory manager

Posted: Sat Sep 19, 2009 4:15 am
by Jens
I'm trying to find the source to the memory manager used on the DS to help me with some debugging. I'm not sure where to look though, and all I've found is the devkitPro tar-ball. Can anyone point me in the right direction?

(What I'm really trying to fix is this: http://forum.gbadev.org/viewtopic.php?t=16862)

Re: Source to memory manager

Posted: Sat Sep 19, 2009 12:30 pm
by vuurrobin
the source code is in the devkitPro svn. you will need an svn client to download it (apparantly not, but it may be easier).

here is the link to the devkitPro's svn:
https://devkitpro.svn.sourceforge.net/s ... pro/trunk/


however, you might want to see this first, to see if this is what you're looking for:
http://forum.gbadev.org/viewtopic.php?t ... getmemfree

Re: Source to memory manager

Posted: Sat Sep 19, 2009 5:40 pm
by Jens
Hmm. I'm not sure what I'm looking for as this is more low-level than I usually poke around, but I didn't find anything in the SVN either. Is the devkitARM code in a different place? Or is the memory manager a part of a gcc package or something? Either way, a find in files for the implementation of malloc or mallinfo came up short.
however, you might want to see this first, to see if this is what you're looking for:
http://forum.gbadev.org/viewtopic.php?t ... getmemfree
Thanks. I've been using that for a while, but I need finer detail. There seems to be an allocation that I'm not sure when or where it's happening, and I need to track it down as it fragments my memory.

Re: Source to memory manager

Posted: Sun Sep 20, 2009 3:13 am
by WinterMute
The memory manager is part of Newlib, it's the ubiquitous dlmalloc. See http://gee.cs.oswego.edu/dl/html/malloc.html for design details. There's also a link to a malloc tracer from the Doug's main page at http://g.oswego.edu/dl/