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

Unified Diff: runtime/vm/dart_api_message.cc

Issue 580903004: Make sure Bigint._digits is always a Uint32List (instead of sometimes null). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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 | « runtime/vm/dart_api_message.h ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_message.cc
===================================================================
--- runtime/vm/dart_api_message.cc (revision 40444)
+++ runtime/vm/dart_api_message.cc (working copy)
@@ -91,11 +91,17 @@
}
+_Dart_CObject* ApiMessageReader::singleton_uint32_typed_data_ = NULL;
+
Dart_CObject* ApiMessageReader::AllocateDartCObjectBigint() {
Dart_CObject* value = AllocateDartCObject(Dart_CObject_kBigint);
value->value.as_bigint.neg = false;
value->value.as_bigint.used = 0;
- value->value.as_bigint.digits = NULL;
+ if (singleton_uint32_typed_data_ == NULL) {
+ singleton_uint32_typed_data_ =
+ AllocateDartCObjectTypedData(Dart_TypedData_kUint32, 0);
+ }
+ value->value.as_bigint.digits = singleton_uint32_typed_data_;
value->type = Dart_CObject_kBigint;
return value;
}
« no previous file with comments | « runtime/vm/dart_api_message.h ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698