Depends entirely on what method you are using to allocate
RAM in the first place. The GBA itself has no concept of
"allocated" memory.
You didn't even say if you were programming in C using a
standard library such as newlib or in assembly with your
own memory management.
I'd guess the former since otherwise you really wouldn't be asking
this question. Let's assume you're using DevkitAdvance or
some other similar gcc-based setup.
Perhaps you would like to know how much memory your
static variables take up : in that case you could use
objdump -h on your ELF file and look at the size of the
.data and .bss sections.
If you are using malloc() and want to know how much
free memory is left, well I can't tell you off the top of my head
but there is certainly a way to ask the allocator what is the
size of the largest free block, and perhaps the sum of all
free blocks though that's possibly less useful. You should
look this up in newlib's documentation or sources.
Hope this helps,
--Jonathan
----- Original Message -----
From: "Wendy" <gadget2032@...>
To: <gbadev@yahoogroups.com>
Sent: Wednesday, March 12, 2003 10:51 PM
Subject: [gbadev] Memory Management
> Is there anyway of keeping track of how much memory is being
> currently used on the GBA? Most of my data resides in ROM and i'm
> trying no to allocate anything dynamically if I can help it. Is there
> a way to keep track of the amount of RAM that i'm currently using?
>
> --Wendy
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>