Revert "Add size_t length argument to v8::ArrayBuffer::Allocator::Free."
authordslomov@chromium.org <dslomov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 2 Aug 2013 12:56:53 +0000 (12:56 +0000)
committerdslomov@chromium.org <dslomov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 2 Aug 2013 12:56:53 +0000 (12:56 +0000)
This reverts r16031 for breaking shared build.

TBR=mstarzinger@chromium.org

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

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

include/v8.h
src/api.cc
src/d8.cc
src/runtime.cc
test/cctest/cctest.cc

index 311ad434de8516dff174558f15dfe8ae45ad8179..11fccdf023999ff3c3a8acf425c669be29cae54c 100644 (file)
@@ -2425,20 +2425,10 @@ class V8EXPORT ArrayBuffer : public Object {
     }
 
     /**
-     * Free the memory block of size |length|, pointed to by |data|.
-     * That memory is guaranteed to be previously allocated by |Allocate|.
+     * Free the memory pointed to |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) = 0;
   };
 
   /**
index d442126ebbb3c23babfa8cec218edf2fd630480c..1ae81b13252e3a1bdf50cb53b66433dd49b053f3 100644 (file)
@@ -3071,12 +3071,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 0f4b5e17ad1287d72826d646ed150132e8cd0e5b..e66a2ece600bb0ab54da79510cb4a7db96f75d89 100644 (file)
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -1635,9 +1635,7 @@ class ShellArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
   virtual void* AllocateUninitialized(size_t length) {
     return malloc(length);
   }
-  virtual void Free(void* data, size_t) { free(data); }
-  // TODO(dslomov): Remove when v8:2823 is fixed.
-  virtual void Free(void* data) { UNREACHABLE(); }
+  virtual void Free(void* data) { free(data); }
 };
 
 
index 97751470426cc62109970a2f17477e364c9e5ba4..df31e70d5c0fcfdefe87e0226717818e8d9ba756 100644 (file)
@@ -689,9 +689,7 @@ void Runtime::FreeArrayBuffer(Isolate* isolate,
   isolate->heap()->AdjustAmountOfExternalAllocatedMemory(
       -static_cast<intptr_t>(allocated_length));
   CHECK(V8::ArrayBufferAllocator() != NULL);
-  V8::ArrayBufferAllocator()->Free(
-      phantom_array_buffer->backing_store(),
-      allocated_length);
+  V8::ArrayBufferAllocator()->Free(phantom_array_buffer->backing_store());
 }
 
 
index a2caf0f3baa7cfd9e8ec36c611803850f857d8f9..94dcce1305223f0f25f6e5456d0959b9f71e04a3 100644 (file)
@@ -99,10 +99,9 @@ v8::Isolate* CcTest::default_isolate_;
 
 
 class CcTestArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
+ public:
   virtual void* Allocate(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(); }
+  virtual void Free(void* data) { free(data); }
 };