Looking at the .map file of my GBA .elf with amap I see several blocks of IWRAM being allocated by libgba. I attached an amap screenshot. Is there any way to reduce that? Heap management could rather be in EWRAM and why a mutex? I probably only need the headers and the interrupt stuff libgba offers. What can I do?
On a tangent: Is there a way to use MaxMOD without libgba?
Reducing libgbas IWRAM footprint
Reducing libgbas IWRAM footprint
- Attachments
-
- mapfile_amap.png
- (193.45 KiB) Not downloaded yet
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Reducing libgbas IWRAM footprint
Traditionally on GBA .data & .bss go in iwram, this is a function of the linkscript & has very little to do with libgba. Bear in mind that EWRAM is 16bit access & is much slower than IWRAM so changing it is likely to have a performance impact.
devkitARM also builds code for platforms where threading is possible, thus there are locks in malloc which do nothing on GBA. If you're that concerned then perhaps you should manage memory yourself.
Yes, it's possible to use maxmod without libgba, I've provided sample code that uses libtonc at https://devkitpro.org/viewtopic.php?f=37&t=8830
devkitARM also builds code for platforms where threading is possible, thus there are locks in malloc which do nothing on GBA. If you're that concerned then perhaps you should manage memory yourself.
Yes, it's possible to use maxmod without libgba, I've provided sample code that uses libtonc at https://devkitpro.org/viewtopic.php?f=37&t=8830
Re: Reducing libgbas IWRAM footprint
Your right. I've done just that. I removed libgba and also got rid of memory management using the GCC options:
-Wl,--wrap=malloc,--wrap=free,--wrap=alloc,--wrap=calloc
All allocations are redirected to my internal methods, which I need anyway. This gives me more control over allocations, but still static stuff can be allocated in IWRAM/EWRAM if needed.
Btw. Does MaxMODs IWRAM footprint depend on the number of channels? It uses ~7-8kB of IWRAM. Could I reduce that?
-Wl,--wrap=malloc,--wrap=free,--wrap=alloc,--wrap=calloc
All allocations are redirected to my internal methods, which I need anyway. This gives me more control over allocations, but still static stuff can be allocated in IWRAM/EWRAM if needed.
Btw. Does MaxMODs IWRAM footprint depend on the number of channels? It uses ~7-8kB of IWRAM. Could I reduce that?
Who is online
Users browsing this forum: No registered users and 5 guests