Function


msoAllocatorEnableDebugMode

Switches allocator to debug mode

Syntax

#include <mso/Allocator.h>
void msoAllocatorEnableDebugMode( MsoAllocator *allocator_ptr,
                                  const u32 enable )

Description

When enable == true, switches allocator to debug mode.
When in the debug mode, at the same time the allocator acquires memory, it writes a debug cookie into the header of the memory acquired.

msoAllocatorIsDebugMode

Returns whether the allocator is operating in debug mode

Syntax

#include <mso/Allocator.h>
u32 msoAllocatorIsDebugMode( const MsoAllocator *allocator_ptr )

Description

Returns whether the allocator is operating in debug mode

msoAllocatorSetDebugCookie

Sets the debug cookie

Syntax

#include <mso/Allocator.h>
void msoAllocatorSetDebugCookie( MsoAllocator *allocator_ptr,
                                 const u32 debug_cookie )

Description

Sets the debug cookie

msoAllocatorGetDebugCookie

Gets the debug cookie

Syntax

#include <mso/Allocator.h>
u32 msoAllocatorGetDebugCookie( const MsoAllocator *allocator_ptr );

Description

Gets the debug cookie

msoAllocatorAllocate

Gets size bytes of memory with an 8-byte boundary

Syntax

#include <mso/Allocator.h>
void *msoAllocatorAllocate( MsoAllocator *allocator_ptr, const u32 size );

Description

Gets size bytes of memory with an 8-byte boundary

msoAllocatorAllocateAligned

Gets size bytes of memory with the boundary specified by align

Syntax

#include <mso/Allocator.h>
void *msoAllocatorAllocateAligned( MsoAllocator *allocator_ptr,
                                   const u32 size, const u16 align );

Description

Gets size bytes of memory with the boundary specified by align align is an index expression and has a minimum value of 3 (8-byte boundary).

msoAllocatorFree

Releases memory

Syntax

#include <mso/Allocator.h>
void msoAllocatorFree( MsoAllocator *allocator_ptr, void *mem_ptr );

Description

Releases memory acquired by msoAllocatorAllocate( ), msoAllocatorAllocateAligned( )

msoSetDefaultAllocator

Sets the default allocator

Syntax

#include <mso/Allocator.h>
void msoSetDefaultAllocator( MsoAllocator *allocator_ptr );

Description

Sets the default allocator. The default allocator is used by msoMalloc( ), msoNallocAligned( ), and msoFree( ).

msoGetDefaultAllocator

Gets the default allocator

Syntax

#include <mso/Allocator.h>
MsoAllocator *msoGetDefaultAllocator( void );

Description

Gets the default allocator

msoMalloc

Acquires memory using the default allocator

Syntax

#include <mso/Allocator.h>
void *msoMalloc( const u32 size );

Description

Acquires memory using the default allocator

msoMallocAligned

Acquires memory using the default allocator

Syntax

#include <mso/Allocator.h>
void *msoMallocAligned( const u32 size, const u16 align );

Description

Acquires memory using the default allocator
The value of align is the same as for msoAllocatorAllocateAligned( ).

msoFree

Releases memory using the default allocator

Syntax

#include <mso/Allocator.h>
void msoFree( void *mem_ptr );

Description

Releases memory using the default allocator