OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // | 42 // |
43 // The list is parameterized by the type of its elements (T) and by an | 43 // The list is parameterized by the type of its elements (T) and by an |
44 // allocation policy (P). The policy is used for allocating lists in | 44 // allocation policy (P). The policy is used for allocating lists in |
45 // the C free store or the zone; see zone.h. | 45 // the C free store or the zone; see zone.h. |
46 | 46 |
47 // Forward defined as | 47 // Forward defined as |
48 // template <typename T, class P = FreeStoreAllocationPolicy> class List; | 48 // template <typename T, class P = FreeStoreAllocationPolicy> class List; |
49 template <typename T, class P> | 49 template <typename T, class P> |
50 class List { | 50 class List { |
51 public: | 51 public: |
52 | |
53 List() { Initialize(0); } | 52 List() { Initialize(0); } |
54 INLINE(explicit List(int capacity)) { Initialize(capacity); } | 53 INLINE(explicit List(int capacity)) { Initialize(capacity); } |
55 INLINE(~List()) { DeleteData(data_); } | 54 INLINE(~List()) { DeleteData(data_); } |
56 | 55 |
57 // Deallocates memory used by the list and leaves the list in a consistent | 56 // Deallocates memory used by the list and leaves the list in a consistent |
58 // empty state. | 57 // empty state. |
59 void Free() { | 58 void Free() { |
60 DeleteData(data_); | 59 DeleteData(data_); |
61 Initialize(0); | 60 Initialize(0); |
62 } | 61 } |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 }; | 164 }; |
166 | 165 |
167 class Map; | 166 class Map; |
168 class Code; | 167 class Code; |
169 typedef List<Map*> MapList; | 168 typedef List<Map*> MapList; |
170 typedef List<Code*> CodeList; | 169 typedef List<Code*> CodeList; |
171 | 170 |
172 } } // namespace v8::internal | 171 } } // namespace v8::internal |
173 | 172 |
174 #endif // V8_LIST_H_ | 173 #endif // V8_LIST_H_ |
OLD | NEW |