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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 | 51 |
52 // Note: There is no need to initialize the Zone; the first time an | 52 // Note: There is no need to initialize the Zone; the first time an |
53 // allocation is attempted, a segment of memory will be requested | 53 // allocation is attempted, a segment of memory will be requested |
54 // through a call to malloc(). | 54 // through a call to malloc(). |
55 | 55 |
56 // Note: The implementation is inherently not thread safe. Do not use | 56 // Note: The implementation is inherently not thread safe. Do not use |
57 // from multi-threaded code. | 57 // from multi-threaded code. |
58 | 58 |
59 class Zone { | 59 class Zone { |
60 public: | 60 public: |
61 ~Zone(); | |
Vitaly Repeshko
2011/08/16 17:52:32
Given that the constructor is private it makes sen
Jakob Kummerow
2011/08/17 08:47:30
Done.
| |
62 | |
61 // Allocate 'size' bytes of memory in the Zone; expands the Zone by | 63 // Allocate 'size' bytes of memory in the Zone; expands the Zone by |
62 // allocating new segments of memory on demand using malloc(). | 64 // allocating new segments of memory on demand using malloc(). |
63 inline void* New(int size); | 65 inline void* New(int size); |
64 | 66 |
65 template <typename T> | 67 template <typename T> |
66 inline T* NewArray(int length); | 68 inline T* NewArray(int length); |
67 | 69 |
68 // Delete all objects and free all memory allocated in the Zone. | 70 // Delete all objects and free all memory allocated in the Zone. |
69 void DeleteAll(); | 71 void DeleteAll(); |
70 | 72 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 public: | 235 public: |
234 ZoneSplayTree() | 236 ZoneSplayTree() |
235 : SplayTree<Config, ZoneListAllocationPolicy>() {} | 237 : SplayTree<Config, ZoneListAllocationPolicy>() {} |
236 ~ZoneSplayTree(); | 238 ~ZoneSplayTree(); |
237 }; | 239 }; |
238 | 240 |
239 | 241 |
240 } } // namespace v8::internal | 242 } } // namespace v8::internal |
241 | 243 |
242 #endif // V8_ZONE_H_ | 244 #endif // V8_ZONE_H_ |
OLD | NEW |