[zone-stats] Use Zone::DeleteArray<T>() in ZoneAllocator::deallocate()

Bug: v8:10572
Change-Id: I0caf2f4a36e21d889e931b75ec86bae5b1571511
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2302895
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68920}
This commit is contained in:
Igor Sheludko 2020-07-16 23:21:17 +02:00 committed by Commit Bot
parent 99fc380656
commit 0326938e95

View File

@ -47,8 +47,8 @@ class ZoneAllocator {
template <typename U>
friend class ZoneAllocator;
T* allocate(size_t n) { return zone_->NewArray<T>(n); }
void deallocate(T* p, size_t) {} // noop for zones
T* allocate(size_t length) { return zone_->NewArray<T>(length); }
void deallocate(T* p, size_t length) { zone_->DeleteArray<T>(p, length); }
size_t max_size() const {
return std::numeric_limits<int>::max() / sizeof(T);