MTek-GDL 0.100.4-muffintrap
Loading...
Searching...
No Matches
Functions
mgdl-alloc.h File Reference

Workaround of windows missing aligned_alloc(aligment, size). More...

#include <stdlib.h>
#include <mgdl/mgdl-types.h>

Go to the source code of this file.

Functions

void * mgdl_AllocateAlignedMemory (sizetype size)
 Use this function when memory needs to be aligned.
 

Detailed Description

Workaround of windows missing aligned_alloc(aligment, size).

mingw-ucrt on Windows does not have aligned_alloc(alignment, size), so this is a workaround since the alignment is only needed on Wii anyway.

Function Documentation

◆ mgdl_AllocateAlignedMemory()

void * mgdl_AllocateAlignedMemory ( sizetype  size)

Use this function when memory needs to be aligned.

Memory needs to be aligned for graphical and audio data on Wii. Anything that is read by gpu or audio device is safest to allocate aligned and also flush

Parameters
sizeSize of memory in bytes
Returns
Address of the reserved memory or nullptr on allocation failure.