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

Unified Diff: runtime/vm/dart_api_impl_test.cc

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
Index: runtime/vm/dart_api_impl_test.cc
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index 14f093d2ae6bb97da35b46fbe415f63546a652fe..fd3d24b234baf1b7cf779f37a2c65f3d47fe6192 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -3386,10 +3386,11 @@ void NewNativePort_send123(Dart_Port dest_port_id,
EXPECT_EQ(Dart_CObject::kNull, message->type);
// Post integer value.
- Dart_CObject response;
- response.type = Dart_CObject::kInt32;
- response.value.as_int32 = 123;
- Dart_PostCObject(reply_port_id, &response);
+ Dart_CObject* response =
+ reinterpret_cast<Dart_CObject*>(Dart_ZoneAllocate(sizeof(Dart_CObject)));
+ response->type = Dart_CObject::kInt32;
+ response->value.as_int32 = 123;
+ Dart_PostCObject(reply_port_id, response);
}
@@ -3401,10 +3402,11 @@ void NewNativePort_send321(Dart_Port dest_port_id,
EXPECT_EQ(Dart_CObject::kNull, message->type);
// Post integer value.
- Dart_CObject response;
- response.type = Dart_CObject::kInt32;
- response.value.as_int32 = 321;
- Dart_PostCObject(reply_port_id, &response);
+ Dart_CObject* response =
+ reinterpret_cast<Dart_CObject*>(Dart_ZoneAllocate(sizeof(Dart_CObject)));
+ response->type = Dart_CObject::kInt32;
+ response->value.as_int32 = 321;
+ Dart_PostCObject(reply_port_id, response);
}

Powered by Google App Engine
This is Rietveld 408576698