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; }
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; }