Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index 208b557da682a073e9b66b7d9add15f056177e86..89c9042ea8e9c5f2ffb1fa67ea7e43412e3e48ca 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -3236,8 +3236,8 @@ class V8_EXPORT ArrayBuffer : public Object { |
public: |
/** |
* Allocator that V8 uses to allocate |ArrayBuffer|'s memory. |
- * The allocator is a global V8 setting. It should be set with |
- * V8::SetArrayBufferAllocator prior to creation of a first ArrayBuffer. |
+ * The allocator is a global V8 setting. It has to be set via |
+ * Isolate::CreateParams. |
* |
* This API is experimental and may change significantly. |
*/ |
@@ -3269,7 +3269,7 @@ class V8_EXPORT ArrayBuffer : public Object { |
* and byte length. |
* |
* The Data pointer of ArrayBuffer::Contents is always allocated with |
- * Allocator::Allocate that is set with V8::SetArrayBufferAllocator. |
+ * Allocator::Allocate that is set via Isolate::CreateParams. |
* |
* This API is experimental and may change significantly. |
*/ |
@@ -3337,7 +3337,7 @@ class V8_EXPORT ArrayBuffer : public Object { |
* should take steps to free memory when it is no longer needed. |
* |
* The memory block is guaranteed to be allocated with |Allocator::Allocate| |
- * that has been set with V8::SetArrayBufferAllocator. |
+ * that has been set via Isolate::CreateParams. |
*/ |
Contents Externalize(); |
@@ -4953,7 +4953,8 @@ class V8_EXPORT Isolate { |
snapshot_blob(NULL), |
counter_lookup_callback(NULL), |
create_histogram_callback(NULL), |
- add_histogram_sample_callback(NULL) {} |
+ add_histogram_sample_callback(NULL), |
+ array_buffer_allocator(NULL) {} |
/** |
* The optional entry_hook allows the host application to provide the |
@@ -4995,6 +4996,12 @@ class V8_EXPORT Isolate { |
*/ |
CreateHistogramCallback create_histogram_callback; |
AddHistogramSampleCallback add_histogram_sample_callback; |
+ |
+ /** |
+ * The ArrayBuffer::Allocator to use for allocating and freeing the backing |
+ * store of ArrayBuffers. |
+ */ |
+ ArrayBuffer::Allocator* array_buffer_allocator; |
}; |
@@ -5114,7 +5121,9 @@ class V8_EXPORT Isolate { |
* |
* V8::Initialize() must have run prior to this. |
*/ |
- static Isolate* New(const CreateParams& params = CreateParams()); |
+ static Isolate* New(const CreateParams& params); |
+ |
+ static V8_DEPRECATED("Always pass CreateParams", Isolate* New()); |
/** |
* Returns the entered isolate for the current thread or NULL in |
@@ -5704,7 +5713,9 @@ class V8_EXPORT V8 { |
* before any code tha uses ArrayBuffers is executed. |
* This allocator is used in all isolates. |
*/ |
- static void SetArrayBufferAllocator(ArrayBuffer::Allocator* allocator); |
+ static V8_DEPRECATE_SOON( |
+ "Use isolate version", |
+ void SetArrayBufferAllocator(ArrayBuffer::Allocator* allocator)); |
/** |
* Check if V8 is dead and therefore unusable. This is the case after |