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

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

Issue 11040062: Renamed Zone->StackZone, BaseZone->Zone, in preparation for changing isolate->get_zone() to return … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review changes Created 8 years, 2 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 | « runtime/vm/dart_api_impl.h ('k') | runtime/vm/growable_array.h » ('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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // It is preferred to use Alloc<T>() instead, as that function can 55 // It is preferred to use Alloc<T>() instead, as that function can
56 // check for integer overflow. If you use AllocUnsafe, you are 56 // check for integer overflow. If you use AllocUnsafe, you are
57 // responsible for avoiding integer overflow yourself. 57 // responsible for avoiding integer overflow yourself.
58 uword AllocUnsafe(intptr_t size) { return zone_.AllocUnsafe(size); } 58 uword AllocUnsafe(intptr_t size) { return zone_.AllocUnsafe(size); }
59 59
60 // Compute the total size of this zone. This includes wasted space that is 60 // Compute the total size of this zone. This includes wasted space that is
61 // due to internal fragmentation in the segments. 61 // due to internal fragmentation in the segments.
62 intptr_t SizeInBytes() const { return zone_.SizeInBytes(); } 62 intptr_t SizeInBytes() const { return zone_.SizeInBytes(); }
63 63
64 private: 64 private:
65 BaseZone* GetBaseZone() { return &zone_; } 65 Zone* GetBaseZone() { return &zone_; }
66 66
67 BaseZone zone_; 67 Zone zone_;
68 68
69 template<typename T> friend class ApiGrowableArray; 69 template<typename T> friend class ApiGrowableArray;
70 DISALLOW_COPY_AND_ASSIGN(ApiZone); 70 DISALLOW_COPY_AND_ASSIGN(ApiZone);
71 }; 71 };
72 72
73 73
74 // Implementation of local handles which are handed out from every 74 // Implementation of local handles which are handed out from every
75 // dart API call, these handles are valid only in the present scope 75 // dart API call, these handles are valid only in the present scope
76 // and are destroyed when a Dart_ExitScope() is called. 76 // and are destroyed when a Dart_ExitScope() is called.
77 class LocalHandle { 77 class LocalHandle {
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 ApiNativeScope::Current()->zone()->GetBaseZone()) {} 674 ApiNativeScope::Current()->zone()->GetBaseZone()) {}
675 ApiGrowableArray() 675 ApiGrowableArray()
676 : BaseGrowableArray<T, ValueObject>( 676 : BaseGrowableArray<T, ValueObject>(
677 ApiNativeScope::Current()->zone()->GetBaseZone()) {} 677 ApiNativeScope::Current()->zone()->GetBaseZone()) {}
678 }; 678 };
679 679
680 680
681 } // namespace dart 681 } // namespace dart
682 682
683 #endif // VM_DART_API_STATE_H_ 683 #endif // VM_DART_API_STATE_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.h ('k') | runtime/vm/growable_array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698