Fix zone_allocator to support comparison
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 19 Feb 2014 08:28:14 +0000 (08:28 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 19 Feb 2014 08:28:14 +0000 (08:28 +0000)
R=danno@chromium.org

Review URL: https://codereview.chromium.org/171713004

Patch from Daniel Clifford <danno@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19468 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/zone-allocator.h

index 5245c6b1bfd45d3d23e5e5efb82a5b4fa4707fba..312d395c8379af143dcaafd530d3c9b58a6e657f 100644 (file)
@@ -69,7 +69,14 @@ class zone_allocator {
   void construct(pointer p, const T& val) {
     new(static_cast<void*>(p)) T(val);
   }
-  void destroy(pointer p) { (static_cast<T*>(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_;