Beispiel #1
0
void HashBase::AllocateBuckets(unsigned size, unsigned numBuckets)
{
    if (ptrs_)
        delete[] ptrs_;

    HashNodeBase** ptrs = new HashNodeBase* [numBuckets + 2];
    unsigned* data = reinterpret_cast<unsigned*>(ptrs);
    data[0] = size;
    data[1] = numBuckets;
    ptrs_ = ptrs;

    ResetPtrs();
}
Beispiel #2
0
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();
}