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

Side by Side Diff: runtime/vm/dart_api_state.h

Issue 342503002: Heap::AllocateExternal may trigger GC, so fix String::MakeExternal. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_DART_API_STATE_H_ 5 #ifndef VM_DART_API_STATE_H_
6 #define VM_DART_API_STATE_H_ 6 #define VM_DART_API_STATE_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 #include "platform/thread.h" 10 #include "platform/thread.h"
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 intptr_t external_size) { 962 intptr_t external_size) {
963 ApiState* state = isolate->api_state(); 963 ApiState* state = isolate->api_state();
964 ASSERT(state != NULL); 964 ASSERT(state != NULL);
965 FinalizablePersistentHandle* ref = is_prologue ? 965 FinalizablePersistentHandle* ref = is_prologue ?
966 state->prologue_weak_persistent_handles().AllocateHandle() : 966 state->prologue_weak_persistent_handles().AllocateHandle() :
967 state->weak_persistent_handles().AllocateHandle(); 967 state->weak_persistent_handles().AllocateHandle();
968 ref->SetPrologueWeakPersistent(is_prologue); 968 ref->SetPrologueWeakPersistent(is_prologue);
969 ref->set_raw(object); 969 ref->set_raw(object);
970 ref->set_peer(peer); 970 ref->set_peer(peer);
971 ref->set_callback(callback); 971 ref->set_callback(callback);
972 // This may trigger GC, so it must be called last.
972 ref->SetExternalSize(external_size, isolate); 973 ref->SetExternalSize(external_size, isolate);
973 return ref; 974 return ref;
974 } 975 }
975 976
976 } // namespace dart 977 } // namespace dart
977 978
978 #endif // VM_DART_API_STATE_H_ 979 #endif // VM_DART_API_STATE_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698