Reviewers: Benedikt Meurer,

Message:
PTAL

Description:
Clean-up v8::ArrayBuffer::Allocator interface

BUG=v8:2823
[email protected]

Please review this at https://codereview.chromium.org/23514050/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+3, -23 lines):
  M include/v8.h
  M src/api.cc
  M test/cctest/cctest.cc


Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 9e44d9eacbe290114f70f91c2f8da1cab2c48c6a..7ffddea18283791af2b6a922b3bd690137da858c 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -2512,27 +2512,12 @@ class V8_EXPORT ArrayBuffer : public Object {
* Allocate |length| bytes. Return NULL if allocation is not successful.
      * Memory does not have to be initialized.
      */
-    virtual void* AllocateUninitialized(size_t length) {
-      // Override with call to |Allocate| for compatibility
-      // with legacy version.
-      return Allocate(length);
-    }
-
+    virtual void* AllocateUninitialized(size_t length) = 0;
     /**
      * Free the memory block of size |length|, pointed to by |data|.
      * That memory is guaranteed to be previously allocated by |Allocate|.
      */
-    virtual void Free(void* data, size_t length) {
-      // Override with call to |Free(void*)| for compatibility
-      // with legacy version.
-      Free(data);
-    }
-
-    /**
-     * Deprecated. Never called directly by V8.
-     * For compatibility with legacy version of this interface.
-     */
-    virtual void Free(void* data);
+    virtual void Free(void* data, size_t length) = 0;
   };

   /**
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index d1f6b78cc0c1d06b0d252071d8bf6c0a2573d5ee..f75a851becd1f6425c4f3a9ddd5a2d83833841ed 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2988,12 +2988,6 @@ void v8::ArrayBuffer::CheckCast(Value* that) {
 }


-void v8::ArrayBuffer::Allocator::Free(void* data) {
-  API_Fatal("v8::ArrayBuffer::Allocator::Free",
-            "Override Allocator::Free(void*, size_t)");
-}
-
-
 void v8::ArrayBufferView::CheckCast(Value* that) {
   i::Handle<i::Object> obj = Utils::OpenHandle(that);
   ApiCheck(obj->IsJSArrayBufferView(),
Index: test/cctest/cctest.cc
diff --git a/test/cctest/cctest.cc b/test/cctest/cctest.cc
index b20696617cf7b171ca7604487f5407305d8613aa..616c6a3a6bdf85dcd26433b3403be3cc2a45b03c 100644
--- a/test/cctest/cctest.cc
+++ b/test/cctest/cctest.cc
@@ -100,6 +100,7 @@ v8::Isolate* CcTest::default_isolate_;

 class CcTestArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
   virtual void* Allocate(size_t length) { return malloc(length); }
+ virtual void* AllocateUninitialized(size_t length) { return malloc(length); }
   virtual void Free(void* data, size_t length) { free(data); }
   // TODO(dslomov): Remove when v8:2823 is fixed.
   virtual void Free(void* data) { UNREACHABLE(); }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to