PlankResult pl_AtomicLL_Destroy (PlankAtomicLLRef p) { PlankResult result = PlankResult_OK; PlankMemoryRef m = pl_MemoryGlobal(); if ((result = pl_AtomicLL_DeInit (p)) != PlankResult_OK) goto exit; result = pl_Memory_Free (m, p); exit: return result; }
PlankLockFreeLinkedListElementRef pl_LockFreeLinkedListElement_Create() { PlankMemoryRef m; PlankLockFreeLinkedListElementRef p; m = pl_MemoryGlobal(); // must use the lock free one when done... nope just live with it and use alogrithms that reuse the memory allocs p = (PlankLockFreeLinkedListElementRef)pl_Memory_AllocateBytes (m, sizeof (PlankLockFreeLinkedListElement)); if (p != PLANK_NULL) pl_MemoryZero (p, sizeof (PlankLockFreeLinkedListElement)); return p; }
PlankIffFileWriterRef pl_IffFileWriter_Create() { PlankMemoryRef m; PlankIffFileWriterRef p; m = pl_MemoryGlobal(); p = (PlankIffFileWriterRef)pl_Memory_AllocateBytes (m, sizeof (PlankIffFileWriter)); if (p != PLANK_NULL) pl_MemoryZero (p, sizeof (PlankIffFileWriter)); return p; }
PlankSimpleMapRef pl_SimpleMap_Create() { PlankMemoryRef m; PlankSimpleMapRef p; m = pl_MemoryGlobal(); p = (PlankSimpleMapRef)pl_Memory_AllocateBytes (m, sizeof (PlankSimpleMap)); if (p != PLANK_NULL) pl_MemoryZero (p, sizeof (PlankSimpleMap)); return p; }
PlankLockRef pl_Lock_Create() { PlankMemoryRef m; PlankLockRef p; m = pl_MemoryGlobal(); p = (PlankLockRef)pl_Memory_AllocateBytes (m, sizeof (PlankLock)); if (p != PLANK_NULL) pl_MemoryZero (p, sizeof (PlankLock)); return p; }
PlankLockFreeQueueRef pl_LockFreeQueue_Create() { PlankMemoryRef m; PlankLockFreeQueueRef p; m = pl_MemoryGlobal(); // OK, creation of the queue isn't itself lock free p = (PlankLockFreeQueueRef)pl_Memory_AllocateBytes (m, sizeof (PlankLockFreeQueue)); if (p != PLANK_NULL) pl_MemoryZero (p, sizeof (PlankLockFreeQueue)); return p; }
PlankResult pl_LockFreeLinkedListElement_Destroy (PlankLockFreeLinkedListElementRef p) { PlankResult result; PlankMemoryRef m; result = PlankResult_OK; m = pl_MemoryGlobal(); if ((result = pl_LockFreeLinkedListElement_DeInit (p)) != PlankResult_OK) goto exit; result = pl_Memory_Free (m, p); exit: return result; }
PlankResult pl_SimpleMapElement_Destroy (PlankSimpleMapElementRef p) { PlankResult result = PlankResult_OK; PlankMemoryRef m = pl_MemoryGlobal(); if (p == PLANK_NULL) { result = PlankResult_MemoryError; goto exit; } result = pl_Memory_Free (m, p); exit: return result; }
PlankSimpleMapElementRef pl_SimpleMapElement_CreateWithData (const PlankLL key, PlankP ptr) { PlankSimpleMapElementRef p; PlankMemoryRef m; m = pl_MemoryGlobal(); p = (PlankSimpleMapElementRef)pl_Memory_AllocateBytes (m, sizeof (PlankSimpleMapElement)); if (p != PLANK_NULL) { p->key = key; p->ptr = ptr; } return p; }
PlankResult pl_SimpleMap_Destroy (PlankSimpleMapRef p) { PlankResult result; PlankMemoryRef m; result = PlankResult_OK; m = pl_MemoryGlobal(); if (p == PLANK_NULL) { result = PlankResult_MemoryError; goto exit; } if ((result = pl_SimpleMap_DeInit (p)) != PlankResult_OK) goto exit; result = pl_Memory_Free (m, p); exit: return result; }
PlankResult pl_AtomicI_Destroy (PlankAtomicIRef p) { PlankMemoryRef m = pl_MemoryGlobal(); return pl_Memory_Free (m, p); }
PlankResult pl_AtomicP_Destroy (PlankAtomicPRef p) { PlankMemoryRef m = pl_MemoryGlobal(); pl_Memory_Free (m, p); return PlankResult_OK; }