GP32 Ram Used/free

Pirotic

Certified Guru
Joined
Feb 16, 2004
Messages
593
Pretty much as the topic says, does anybody know a function or some code to return how much RAM the GP32 has used/free?

regards
Pirotic
 

Pirotic

Certified Guru
Joined
Feb 16, 2004
Messages
593
indeed, seems to work!

it returns: 6660052

does anybody know how much RAM total the GP32 has when converted to bytes? (i assume this is displaying bytes)

i figure its (mb * 1,048,576) for bytes, but im sure one of you guys will correct me :D

couldn't find a function to show how much ram was used, so i'll have to work it out from the total :p
 

Squidge

Certified Guru
Joined
Nov 16, 2003
Messages
8,495
Location
UK
Website
Visit site
Personally, I use my own malloc/free functions, then I can keep track of everywhere I've used memory allocation, what for, and if I ever forget to free any (all memory allocations are stored in a linked list). It also means that memory allocation failures give a bit more informative output without having to check the result code all the time.

6660052 is indeed 6.35mb. (1mb = 1024*1024).
 

StoneThrower

Still Fresh
Joined
Apr 14, 2004
Messages
5
Location
Sunset Beach, CA, USA
Website
www.dgmicrosys.com
I wrote a very basic progam just to see what's the maximum chunk of memory I can allocate, using zmalloc().
After quite a few fine-tuned try-and-miss attempts, I turned out that maximal size of single, monolitic peace of RAM available to program is somewhere 5.7Mb <_< and goes downwards, depending of size of your program, static variables, and stack.
 
Top