gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Memory Usage

#36861 - Bojangles - Wed Mar 02, 2005 5:13 pm

I'm trying to implement a Tile memory manager similar to what Raphael Baptista explains in his artilcle, and what TwoHeaded software implemented with the Earth3 demo.

Here's my trouble - when I declare the "Killer Array" of global tile numbers, it's something to the tune of 64k (32k shorts). And just declaring that causes my game to no longer run.

I figure it must be a memory thing?

Is there any easy way to track how much memory I'm using, I'm using straight C, so it's probably static declarations that are killing me right now, but I don't really feel like going through all my classes and counting sizeof's...

Thanks,

Bojangles.

#36862 - Miked0801 - Wed Mar 02, 2005 5:18 pm

You must declare this in EWRAM - not as a normal array which is casuing your crash. See examples on how to do this in the demos and samples.

#36932 - Bojangles - Thu Mar 03, 2005 11:07 pm

Miked0801 wrote:
You must declare this in EWRAM - not as a normal array which is casuing your crash. See examples on how to do this in the demos and samples.


That did the trick.. thanks!! I had attempted this BG MemMgr a while back, and got frustrated with that stupid bug, and just left it... but now it's full steam ahead!

#36969 - Lord Graga - Fri Mar 04, 2005 1:19 pm

One thing to note is, that in DevkitARM, at least, malloc() will automattically allocate memory from EWRAM.