Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Memory Management   Message List  
Reply | Forward Message #13814 of 15019 |
Re: [gbadev] Memory Management

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/
>
>
>





Thu Mar 13, 2003 10:34 am

jonathan.perret@...
Send Email Send Email

Forward
Message #13814 of 15019 |
Expand Messages Author Sort by Date

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...
Wendy
nekowendy
Offline Send Email
Mar 13, 2003
10:07 am

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...
Jonathan Perret
jonathan.perret@...
Send Email
Mar 13, 2003
11:42 am

... You can keep track of how much the stack pointer has extended downwards to guage how much space you're using for local variables and such. You should be...
Pete
dooby@...
Send Email
Mar 13, 2003
12:06 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help