All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kzs_memory.h File Reference

System memory manager. More...

#include <system/debug/kzs_counter.h>
#include <system/wrappers/kzs_wrapper.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

Macros

#define DEBUG_ALLOCATIONS
 Enable debug output for every allocation and deallocation of system memory. More...
 

Typedefs

typedef size_t kzSizeT
 Memory allocation size type. More...
 

Functions

kzsError kzsMemoryInitialize (void)
 Initialize system memory management. More...
 
kzsError kzsMemoryUninitialize (void)
 Uninitialize system memory management. More...
 
KANZI_API void * kzsMalloc (kzSizeT size)
 System level malloc. More...
 
void * kzsRealloc (void *pointer, kzSizeT newSize)
 System level malloc. More...
 
KANZI_API void kzsFree (void *pointer)
 System level free. More...
 
KZ_INLINE void kzsMemcpy (void *destinationPointer, const void *sourcePointer, kzSizeT size)
 System level memcpy. More...
 
KZ_INLINE void kzsMemmove (void *destinationPointer, const void *sourcePointer, kzSizeT size)
 System level memmove. More...
 
KZ_INLINE void kzsMemset (void *pointer, kzInt valueToSet, kzSizeT size)
 System level memset. More...
 
kzUint kzsMemoryGetAllocationCount (void)
 Gets the number of active memory allocations. More...
 
void kzsMemoryResetAllocationCount (void)
 Resets the number of active memory allocations. More...
 

Detailed Description

System memory manager.

Copyright 2008-2020 by Rightware. All rights reserved.

Macro Definition Documentation

#define DEBUG_ALLOCATIONS

Enable debug output for every allocation and deallocation of system memory.

Typedef Documentation

typedef size_t kzSizeT

Memory allocation size type.

Function Documentation

kzsError kzsMemoryInitialize ( void  )

Initialize system memory management.

kzsError kzsMemoryUninitialize ( void  )

Uninitialize system memory management.

KANZI_API void* kzsMalloc ( kzSizeT  size)

System level malloc.

void* kzsRealloc ( void *  pointer,
kzSizeT  newSize 
)

System level malloc.

KANZI_API void kzsFree ( void *  pointer)

System level free.

KZ_INLINE void kzsMemcpy ( void *  destinationPointer,
const void *  sourcePointer,
kzSizeT  size 
)

System level memcpy.

KZ_INLINE void kzsMemmove ( void *  destinationPointer,
const void *  sourcePointer,
kzSizeT  size 
)

System level memmove.

KZ_INLINE void kzsMemset ( void *  pointer,
kzInt  valueToSet,
kzSizeT  size 
)

System level memset.

kzUint kzsMemoryGetAllocationCount ( void  )

Gets the number of active memory allocations.

This returns a non-zero number only in debug builds.

void kzsMemoryResetAllocationCount ( void  )

Resets the number of active memory allocations.