OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ALLOCATION_H_ | 5 #ifndef VM_ALLOCATION_H_ |
6 #define VM_ALLOCATION_H_ | 6 #define VM_ALLOCATION_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/base_isolate.h" | 9 #include "vm/base_isolate.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
11 | 11 |
12 namespace dart { | 12 namespace dart { |
13 | 13 |
14 // Forward declarations. | 14 // Forward declarations. |
15 class Isolate; | 15 class Isolate; |
16 | 16 |
17 // Stack allocated objects subclass from this base class. Objects of this type | 17 // Stack allocated objects subclass from this base class. Objects of this type |
18 // cannot be allocated on either the C or object heaps. Destructors for objects | 18 // cannot be allocated on either the C or object heaps. Destructors for objects |
19 // of this type will not be run unless the stack is unwound through normal | 19 // of this type will not be run unless the stack is unwound through normal |
20 // program control flow. | 20 // program control flow. |
21 class ValueObject { | 21 class ValueObject { |
22 public: | 22 public: |
23 ValueObject() { } | 23 ValueObject() { } |
24 ~ValueObject() { } | 24 ~ValueObject() { } |
25 | 25 |
26 private: | 26 private: |
27 DISALLOW_ALLOCATION(); | 27 DISALLOW_ALLOCATION(); |
28 // TODO(5411081): Add DISALLOW_COPY_AND_ASSIGN(ValueObject) once the mac | 28 DISALLOW_COPY_AND_ASSIGN(ValueObject); |
29 // build issue is resolved. | |
30 }; | 29 }; |
31 | 30 |
32 | 31 |
33 // Stack resources subclass from this base class. The VM will ensure that the | 32 // Stack resources subclass from this base class. The VM will ensure that the |
34 // destructors of these objects are called before the stack is unwound past the | 33 // destructors of these objects are called before the stack is unwound past the |
35 // objects location on the stack. Use stack resource objects if objects | 34 // objects location on the stack. Use stack resource objects if objects |
36 // need to be destroyed even in the case of exceptions when a Longjump is done | 35 // need to be destroyed even in the case of exceptions when a Longjump is done |
37 // to a stack frame above the frame where these objects were allocated. | 36 // to a stack frame above the frame where these objects were allocated. |
38 class StackResource { | 37 class StackResource { |
39 public: | 38 public: |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // deallocated by invoking DeleteAll() on the zone they live in. | 108 // deallocated by invoking DeleteAll() on the zone they live in. |
110 void operator delete(void* pointer) { UNREACHABLE(); } | 109 void operator delete(void* pointer) { UNREACHABLE(); } |
111 | 110 |
112 private: | 111 private: |
113 DISALLOW_COPY_AND_ASSIGN(ZoneAllocated); | 112 DISALLOW_COPY_AND_ASSIGN(ZoneAllocated); |
114 }; | 113 }; |
115 | 114 |
116 } // namespace dart | 115 } // namespace dart |
117 | 116 |
118 #endif // VM_ALLOCATION_H_ | 117 #endif // VM_ALLOCATION_H_ |
OLD | NEW |