| Index: runtime/vm/dart_api_impl.cc
|
| diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
|
| index ebffdb406f0aadc3c20661f76c16a93f20216a42..4b7ac9bdcca82813377d59c876ca0596c35cbd16 100644
|
| --- a/runtime/vm/dart_api_impl.cc
|
| +++ b/runtime/vm/dart_api_impl.cc
|
| @@ -2522,4 +2522,21 @@ DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size) {
|
| }
|
| }
|
|
|
| +
|
| +DART_EXPORT uint8_t* Dart_ZoneAllocate(intptr_t size) {
|
| + ApiZone* zone;
|
| + Isolate* isolate = Isolate::Current();
|
| + if (isolate != NULL) {
|
| + ApiState* state = isolate->api_state();
|
| + if (state == NULL) return NULL;
|
| + ApiLocalScope* scope = state->top_scope();
|
| + zone = &scope->zone();
|
| + } else {
|
| + ApiNativeScope* scope = ApiNativeScope::Current();
|
| + if (scope == NULL) return NULL;
|
| + zone = &scope->zone();
|
| + }
|
| + return reinterpret_cast<uint8_t*>(zone->Allocate(size));
|
| +}
|
| +
|
| } // namespace dart
|
|
|