Archived

This topic is now archived and is closed to further replies.

LeoMaheo

Checking the amount of free memory (GBA)

Recommended Posts

Is there some way to get to know how much memory that is available in EWRAM or IWRAM in the middle of a program ? I know it''s 256/32 at startup, but when you''ve run the program for a while, how can you tell how much that is left ?? That could be really usefull to detect memory leaks !! I tried this: allocator byte_alloc; dprintf( "%i", byte_alloc.max_size() ); but max_size() just returned -1. Why ?? Does anyone know what to do ? By the way, what is a ''ctour'' and a ''dtour'' ?? They are mentioned sometimes and I have no clue !!

Share this post


Link to post
Share on other sites
None seems to know or care...
But now I know how to do ! I read about it at:

http://www.flipcode.com/tutorials/tut_memleak.shtml

( you just overload ''new'' and ''delete'' and then store all allocations in a map, you can use the macros __LINE__ and __FILE__ to trace where things were allocated (and pass them to ''new'') and sometimes ju just dump all allocated things on a debug console )

Share this post


Link to post
Share on other sites