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 > malloc not using all EWRAM

#62084 - cyberg - Sun Nov 27, 2005 8:06 am

Hi,

My problem is that allocating memory with malloc, it will return null pointers just before reaching address 0x02007000, but it's supposed to go up to 0x02040000. and that's the value specified in my linkscript :
__memmap_ewram_end = 0x02040000;

I also checked with the memory viewer of Visual Boy Advance and memory between 0x02007000 and 0x02040000 is filled with zeros, so I guest it's not used.

Someone has an idea for this?

Thx for your help

Etienne Houle

#62085 - cyberg - Sun Nov 27, 2005 8:22 am

I did my test at the creation of my application and I can allocate up to 0x02040000... so I think I'm getting some memory corruption somewhere!!
_________________
Etienne Houle

#62090 - keldon - Sun Nov 27, 2005 9:43 am

malloc also has to store data about your allocation. Could it be possible that malloc is beginning to store its data in On-Board WRAM - i.e. it has some storage of its tables in the in-chip which enables it to utilize all On Board WRAM space. If so then you would benefit by allocating larger chunks of data at once and managing it yourself.