753 B
753 B
ProxyAllocator::Reallocate
通过底层分配器重分配内存。
void* Reallocate(void* ptr, size_t newSize) override;
行为说明
当前实现会先加锁,然后仅做一件事:
return m_underlying->Reallocate(ptr, newSize);
参数
ptr- 原指针。newSize- 新大小。
返回值
void*- 底层分配器返回的新指针。
当前实现限制
- 不更新
totalAllocated、totalFreed、peakAllocated或allocationCount。 - 如果底层分配器会移动内存,这里的返回值可能与
ptr不同。 - 如果
m_underlying == nullptr,当前实现会直接解引用空指针。