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

Unified Diff: runtime/include/dart_api.h

Issue 9347040: Add API function Dart_ZoneAllocate (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from iposva@ Created 8 years, 10 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 | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/dart_api_state.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index b8370c0c3d836b771972154c3bae1745b8f0c168..4831eedb2c2b0b121bfeb912cf003e4f24687183 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -1810,4 +1810,26 @@ DART_EXPORT Dart_Handle Dart_SetNativeResolver(
DART_EXPORT void Dart_InitPprofSupport();
DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size);
+// --- Misc ----
+
+/**
+ * The Dart VM uses zone allocation for temporary structures. Zones
+ * support very fast allocation of small chunks of memory. The chunks
+ * cannot be deallocated individually, but instead zones support
+ * deallocating all chunks in one fast operation.
+ *
+ * This function makes it possible for the embedder to allocate
+ * temporary data in the VMs zone allocator.
+ *
+ * Zone allocation is possible:
+ * 1. when inside a scope where local handles can be allocated
+ * 2. when processing a message from a native port.
+ *
+ * \param size Size of the memory to allocate.
+ *
+ * \return A pointer to the allocated memory. NULL if allocation
+ * failed. Failure might due to is no current VM zone.
+ */
+DART_EXPORT uint8_t* Dart_ZoneAllocate(intptr_t size);
turnidge 2012/02/16 17:54:56 I would rename this to Dart_ScopeAllocate and move
Søren Gjesse 2012/02/17 07:43:09 Done.
+
#endif // INCLUDE_DART_API_H_
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/dart_api_state.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698