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

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 turnidge@ 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 db2793f785e72d40657a27deebbc060a62efcc15..aedc4874e4e46c97530035de0c62cc3fac8b4da6 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -3390,10 +3390,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_ScopeAllocate(sizeof(Dart_CObject)));
+ response->type = Dart_CObject::kInt32;
+ response->value.as_int32 = 123;
+ Dart_PostCObject(reply_port_id, response);
}
@@ -3405,10 +3406,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_ScopeAllocate(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