Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: include/v8.h

Issue 1978773002: [api] Clarify expectations of ArrayBuffer::Allocator in API (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add one more comment Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 52b6192b87643bec0a0abff62dac9864da01baf7..049a7f3e14010b2dc212077d59b2afc6880bebb6 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -3453,10 +3453,20 @@ enum class ArrayBufferCreationMode { kInternalized, kExternalized };
class V8_EXPORT ArrayBuffer : public Object {
public:
/**
- * Allocator that V8 uses to allocate |ArrayBuffer|'s memory.
+ * A thread-safe allocator that V8 uses to allocate |ArrayBuffer|'s memory.
* The allocator is a global V8 setting. It has to be set via
* Isolate::CreateParams.
*
+ * Memory allocated through this allocator by V8 is accounted for as external
+ * memory by V8. Note that V8 keeps track of the memory for all internalized
+ * |ArrayBuffer|s. Responsibility for tracking external memory (using
+ * Isolate::AdjustAmountOfExternalAllocatedMemory) is handed over to the
+ * embedder upon externalization and taken over upon internalization (creating
+ * an internalized buffer from an existing buffer).
+ *
+ * Note that it is unsafe to call back into V8 from any of the allocator
+ * functions.
+ *
* This API is experimental and may change significantly.
*/
class V8_EXPORT Allocator { // NOLINT
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698