Checking the amount of free memory (GBA)

Started by
2 comments, last by LeoMaheo 21 years, 8 months ago
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 !!
I like to write games.. and to do real sports.
Advertisement
Well, actually I wrote:

allocator < char > byte_alloc

but the '' < '' and '' > '' (smaller than and larger than) seem to have vanished
I like to write games.. and to do real sports.
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 )
I like to write games.. and to do real sports.
ctor and dtor are acronyms for "c onstructor " and "d estructor "

[edited by - darookie on August 10, 2002 6:28:06 PM]

This topic is closed to new replies.

Advertisement