Chromium Code Reviews| 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_ |