mirror of https://github.com/mgba-emu/mgba.git
3DS: Use malloc instead of linearAlloc for most things
This commit is contained in:
parent
f77cdf4eda
commit
33e3fb9a45
|
@ -10,10 +10,10 @@
|
||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
|
|
||||||
void* anonymousMemoryMap(size_t size) {
|
void* anonymousMemoryMap(size_t size) {
|
||||||
return linearAlloc(size);
|
return malloc(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mappedMemoryFree(void* memory, size_t size) {
|
void mappedMemoryFree(void* memory, size_t size) {
|
||||||
UNUSED(size);
|
UNUSED(size);
|
||||||
linearFree(memory);
|
free(memory);
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ static void _setup(struct GBAGUIRunner* runner) {
|
||||||
}
|
}
|
||||||
|
|
||||||
GBAVideoSoftwareRendererCreate(&renderer);
|
GBAVideoSoftwareRendererCreate(&renderer);
|
||||||
renderer.outputBuffer = anonymousMemoryMap(256 * VIDEO_VERTICAL_PIXELS * 2);
|
renderer.outputBuffer = linearAlloc(256 * VIDEO_VERTICAL_PIXELS * 2);
|
||||||
renderer.outputBufferStride = 256;
|
renderer.outputBufferStride = 256;
|
||||||
runner->context.renderer = &renderer.d;
|
runner->context.renderer = &renderer.d;
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ int main() {
|
||||||
GBAGUIDeinit(&runner);
|
GBAGUIDeinit(&runner);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
mappedMemoryFree(renderer.outputBuffer, 0);
|
linearFree(renderer.outputBuffer);
|
||||||
|
|
||||||
if (logFile) {
|
if (logFile) {
|
||||||
logFile->close(logFile);
|
logFile->close(logFile);
|
||||||
|
|
Loading…
Reference in New Issue