@@ -119,14 +119,6 @@ void* NodeArrayBufferAllocator::AllocateUninitialized(size_t size) {
119119 return ret;
120120}
121121
122- void * NodeArrayBufferAllocator::Reallocate (
123- void * data, size_t old_size, size_t size) {
124- void * ret = allocator_->Reallocate (data, old_size, size);
125- if (LIKELY (ret != nullptr ) || UNLIKELY (size == 0 ))
126- total_mem_usage_.fetch_add (size - old_size, std::memory_order_relaxed);
127- return ret;
128- }
129-
130122void NodeArrayBufferAllocator::Free (void * data, size_t size) {
131123 total_mem_usage_.fetch_sub (size, std::memory_order_relaxed);
132124 allocator_->Free (data, size);
@@ -156,31 +148,6 @@ void DebuggingArrayBufferAllocator::Free(void* data, size_t size) {
156148 NodeArrayBufferAllocator::Free (data, size);
157149}
158150
159- void * DebuggingArrayBufferAllocator::Reallocate (void * data,
160- size_t old_size,
161- size_t size) {
162- Mutex::ScopedLock lock (mutex_);
163- void * ret = NodeArrayBufferAllocator::Reallocate (data, old_size, size);
164- if (ret == nullptr ) {
165- if (size == 0 ) { // i.e. equivalent to free().
166- // suppress coverity warning as data is used as key versus as pointer
167- // in UnregisterPointerInternal
168- // coverity[pass_freed_arg]
169- UnregisterPointerInternal (data, old_size);
170- }
171- return nullptr ;
172- }
173-
174- if (data != nullptr ) {
175- auto it = allocations_.find (data);
176- CHECK_NE (it, allocations_.end ());
177- allocations_.erase (it);
178- }
179-
180- RegisterPointerInternal (ret, size);
181- return ret;
182- }
183-
184151void DebuggingArrayBufferAllocator::RegisterPointer (void * data, size_t size) {
185152 Mutex::ScopedLock lock (mutex_);
186153 NodeArrayBufferAllocator::RegisterPointer (data, size);
0 commit comments