#include <revolution/so.h>
typedef void* ( *SOAlloc )( u32 name, s32 size );
typedef void ( *SOFree ) ( u32 name, void* ptr, s32 size );
typedef struct SOLibraryConfig SOLibraryConfig;
struct SOLibraryConfig
{
SOAlloc alloc;
SOFree free;
};
The structure that defines the function to be called by the SO Library when actively allocating and deallocating work buffers. Specified when the SOInit function is called.
Note: With functions that are specified for alloc, allocate a 32-byte-aligned buffer from MEM2. If the SO library is used by multiple threads, it is possible for alloc to be called multiple times. As a result, in multi-threaded applications, be sure to perform exclusion control among threads as necessary with all functions that are specified for alloc.
| alloc |
Specifies the function called by the SO Library when actively allocating a work buffer. Return the leading pointer to the allocated buffer as a return value. Return a null pointer when the buffer cannot be allocated.The arguments called from the SO Library are as follows:
|
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| free |
Specifies the function called by the SO Library when deallocating a work buffer that was actively allocated. The arguments called from the SO Library are as follows:
|
2007/01/31 Initial version.
CONFIDENTIAL