mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-06-15 06:31:39 -04:00
acfc04d0ac
* Add the flag and fix errors * switch assert and skin matrix * new LUS * Use normal assert * hopefully fix WiiU Signed-off-by: Louis <louist103@pop-os.localdomain> --------- Signed-off-by: Louis <louist103@pop-os.localdomain> Co-authored-by: Louis <louist103@pop-os.localdomain> Co-authored-by: Christopher Leggett <chris@leggett.dev>
44 lines
970 B
C
44 lines
970 B
C
#include "z64.h"
|
|
#include <assert.h>
|
|
#ifndef __APPLE__
|
|
#include <malloc.h>
|
|
#endif
|
|
#include <stdlib.h>
|
|
|
|
#ifndef _MSC_VER
|
|
#include <unistd.h>
|
|
#endif
|
|
|
|
u8* gAudioHeap;
|
|
u8* gSystemHeap;
|
|
|
|
void Heaps_Alloc(void)
|
|
{
|
|
#ifdef _MSC_VER
|
|
gAudioHeap = (u8*)_aligned_malloc(AUDIO_HEAP_SIZE, 0x10);
|
|
gSystemHeap = (u8*)_aligned_malloc(SYSTEM_HEAP_SIZE, 0x10);
|
|
#elif defined(_POSIX_VERSION) && (_POSIX_VERSION >= 200112L)
|
|
if (posix_memalign((void**)&gAudioHeap, 0x10, AUDIO_HEAP_SIZE) != 0)
|
|
gAudioHeap = NULL;
|
|
if (posix_memalign((void**)&gSystemHeap, 0x10, SYSTEM_HEAP_SIZE) != 0)
|
|
gSystemHeap = NULL;
|
|
#else
|
|
gAudioHeap = (u8*)memalign(0x10, AUDIO_HEAP_SIZE);
|
|
gSystemHeap = (u8*)memalign(0x10, SYSTEM_HEAP_SIZE);
|
|
#endif
|
|
|
|
assert(gAudioHeap != NULL);
|
|
assert(gSystemHeap != NULL);
|
|
}
|
|
|
|
void Heaps_Free(void)
|
|
{
|
|
#ifdef _MSC_VER
|
|
_aligned_free(gAudioHeap);
|
|
_aligned_free(gSystemHeap);
|
|
#else
|
|
free(gAudioHeap);
|
|
free(gSystemHeap);
|
|
#endif
|
|
}
|