Chromium Code Reviews| Index: runtime/vm/snapshot.cc |
| diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc |
| index f4e69460b8f55acdf07f10c463f9d6a803823309..316df393de91ab0a4709c17cf9a2eaddeb2aa921 100644 |
| --- a/runtime/vm/snapshot.cc |
| +++ b/runtime/vm/snapshot.cc |
| @@ -249,10 +249,12 @@ RawBigint* SnapshotReader::NewBigint(const char* hex_string) { |
| ASSERT(isolate()->no_gc_scope_depth() != 0); |
| cls_ = object_store()->bigint_class(); |
| intptr_t bigint_length = BigintOperations::ComputeChunkLength(hex_string); |
| - const Bigint& result = Bigint::Handle(reinterpret_cast<RawBigint*>( |
| - AllocateUninitialized(cls_, Bigint::InstanceSize(bigint_length)))); |
| - BigintOperations::FromHexCString(hex_string, result); |
| - return result.raw(); |
| + RawBigint* obj = reinterpret_cast<RawBigint*>( |
| + AllocateUninitialized(cls_, Bigint::InstanceSize(bigint_length))); |
| + obj->ptr()->allocated_length_ = bigint_length; |
| + obj->ptr()->signed_length_ = bigint_length; |
|
siva
2012/04/26 04:45:04
why not add a set_allocated_length() and set_signe
cshapiro
2012/04/26 06:34:53
Hmm... I tried to make the code look like the rest
siva
2012/04/26 17:17:44
Agree, I didn't realize we already had a NoGCScope
|
| + BigintOperations::FromHexCString(hex_string, Bigint::Handle(obj)); |
| + return obj; |
| } |