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

Threaded memory manager. More...

Functions

kzsError kzcMemoryManagerCreateThreadedManager (struct KzcMemoryManager *parentManager, struct KzcMemoryManager **out_memoryManager)
 Creates a new memory manager, which wraps another memory manager but introduces thread-safety into allocations. More...
 
kzBool kzcMemoryIsThreadedManager (const struct KzcMemoryManager *memoryManager)
 Checks whether the given memory manager is threaded memory manager or not. More...
 
struct KzcMemoryManagerkzcMemoryThreadedGetParentManager (const struct KzcMemoryManager *memoryManager)
 Get the parent memory manager from a threaded memory manager. More...
 
kzBool kzcMemoryThreadedIsLockingEnabled (const struct KzcMemoryManager *memoryManager)
 Is locking enabled? More...
 
void kzcMemoryThreadedSetLockingEnabled (struct KzcMemoryManager *memoryManager, kzBool enabled)
 Enable or disable locking on threaded memory manager. More...
 

Detailed Description

Threaded memory manager.

Wraps another memory manager within thread guards. The thread guards are enabled by default and can be toggled with kzcMemoryThreadedSetLockingEnabled().

Copyright 2008-2020 by Rightware. All rights reserved.

Function Documentation

kzsError kzcMemoryManagerCreateThreadedManager ( struct KzcMemoryManager parentManager,
struct KzcMemoryManager **  out_memoryManager 
)

Creates a new memory manager, which wraps another memory manager but introduces thread-safety into allocations.

kzBool kzcMemoryIsThreadedManager ( const struct KzcMemoryManager memoryManager)

Checks whether the given memory manager is threaded memory manager or not.

struct KzcMemoryManager* kzcMemoryThreadedGetParentManager ( const struct KzcMemoryManager memoryManager)

Get the parent memory manager from a threaded memory manager.

kzBool kzcMemoryThreadedIsLockingEnabled ( const struct KzcMemoryManager memoryManager)

Is locking enabled?

void kzcMemoryThreadedSetLockingEnabled ( struct KzcMemoryManager memoryManager,
kzBool  enabled 
)

Enable or disable locking on threaded memory manager.

Note that ongoing memory management may have unexpected results if locking is turned off while multiple threads are using the manager. Only turn locking on or off when only one thread can be accessing the manager.