コード例 #1
0
ファイル: DL_List.c プロジェクト: niedzielski/swankmania
void DLL_Insert( DL_List * l, DLL_Node * Prev, void * Data )
{
  DLL_Node * n;
  assert( l );
  n = AllocatorAllocate( l->NodeAllocator );
  assert( n );
  n->Data = Data;
  Attach( l, n, Prev );
}
コード例 #2
0
ファイル: HashBase.cpp プロジェクト: FloodProject/flood
NAMESPACE_CORE_BEGIN

void HashBase::AllocateBuckets(unsigned size, unsigned numBuckets)
{
    if (this->ptrs)
        Deallocate(this->ptrs);
    
    HashNodeBase** ptrs = static_cast<HashNodeBase**>(AllocatorAllocate(AllocatorGetHeap(), 
        (numBuckets + 2)*sizeof(HashNodeBase*), 0));
    unsigned* data = reinterpret_cast<unsigned*>(ptrs);
    data[0] = size;
    data[1] = numBuckets;
    this->ptrs = ptrs;
    
    ResetPtrs();
}
コード例 #3
0
static void* ENET_CALLBACK enet_custom_malloc(size_t size)
{
    return AllocatorAllocate(gs_NetworkAllocator, size, 0);
}