Revision: 16650
Author:   [email protected]
Date:     Wed Sep 11 12:54:28 2013 UTC
Log:      Clean-up v8::ArrayBuffer::Allocator interface

BUG=v8:2823
[email protected]

Review URL: https://codereview.chromium.org/23514050
http://code.google.com/p/v8/source/detail?r=16650

Modified:
 /branches/bleeding_edge/include/v8.h
 /branches/bleeding_edge/src/api.cc
 /branches/bleeding_edge/test/cctest/cctest.cc

=======================================
--- /branches/bleeding_edge/include/v8.h        Wed Sep 11 10:28:09 2013 UTC
+++ /branches/bleeding_edge/include/v8.h        Wed Sep 11 12:54:28 2013 UTC
@@ -2512,27 +2512,12 @@
* 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;
   };

   /**
=======================================
--- /branches/bleeding_edge/src/api.cc  Tue Sep 10 11:13:55 2013 UTC
+++ /branches/bleeding_edge/src/api.cc  Wed Sep 11 12:54:28 2013 UTC
@@ -2986,12 +2986,6 @@
            "v8::ArrayBuffer::Cast()",
            "Could not convert to ArrayBuffer");
 }
-
-
-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) {
=======================================
--- /branches/bleeding_edge/test/cctest/cctest.cc Tue Aug 20 13:55:52 2013 UTC +++ /branches/bleeding_edge/test/cctest/cctest.cc Wed Sep 11 12:54:28 2013 UTC
@@ -100,6 +100,7 @@

 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