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