From 71be0fdb4e2f8b793cf45e159706a0b9f1539251 Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Wed, 19 Feb 2014 08:28:14 +0000 Subject: [PATCH] Fix zone_allocator to support comparison R=danno@chromium.org Review URL: https://codereview.chromium.org/171713004 Patch from Daniel Clifford . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19468 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/zone-allocator.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/zone-allocator.h b/src/zone-allocator.h index 5245c6b1bf..312d395c83 100644 --- a/src/zone-allocator.h +++ b/src/zone-allocator.h @@ -69,7 +69,14 @@ class zone_allocator { void construct(pointer p, const T& val) { new(static_cast(p)) T(val); } - void destroy(pointer p) { (static_cast(p))->~T(); } + void destroy(pointer p) { p->~T(); } + + bool operator==(zone_allocator const& other) { + return zone_ == other.zone_; + } + bool operator!=(zone_allocator const& other) { + return zone_ != other.zone_; + } private: Zone* zone_;