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

Side by Side Diff: src/zone/zone.h

Issue 2360983002: Enable component builds for fuzzers (Closed)
Patch Set: Rebase Created 4 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
« no previous file with comments | « src/zone/accounting-allocator.h ('k') | test/fuzzer/fuzzer.gyp » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_ZONE_ZONE_H_ 5 #ifndef V8_ZONE_ZONE_H_
6 #define V8_ZONE_ZONE_H_ 6 #define V8_ZONE_ZONE_H_
7 7
8 #include <limits> 8 #include <limits>
9 9
10 #include "src/base/hashmap.h" 10 #include "src/base/hashmap.h"
(...skipping 11 matching lines...) Expand all
22 // the Zone supports deallocating all chunks in one fast 22 // the Zone supports deallocating all chunks in one fast
23 // operation. The Zone is used to hold temporary data structures like 23 // operation. The Zone is used to hold temporary data structures like
24 // the abstract syntax tree, which is deallocated after compilation. 24 // the abstract syntax tree, which is deallocated after compilation.
25 // 25 //
26 // Note: There is no need to initialize the Zone; the first time an 26 // Note: There is no need to initialize the Zone; the first time an
27 // allocation is attempted, a segment of memory will be requested 27 // allocation is attempted, a segment of memory will be requested
28 // through a call to malloc(). 28 // through a call to malloc().
29 // 29 //
30 // Note: The implementation is inherently not thread safe. Do not use 30 // Note: The implementation is inherently not thread safe. Do not use
31 // from multi-threaded code. 31 // from multi-threaded code.
32 class Zone final { 32 class V8_EXPORT_PRIVATE Zone final {
33 public: 33 public:
34 explicit Zone(AccountingAllocator* allocator); 34 explicit Zone(AccountingAllocator* allocator);
35 ~Zone(); 35 ~Zone();
36 36
37 // Allocate 'size' bytes of memory in the Zone; expands the Zone by 37 // Allocate 'size' bytes of memory in the Zone; expands the Zone by
38 // allocating new segments of memory on demand using malloc(). 38 // allocating new segments of memory on demand using malloc().
39 void* New(size_t size); 39 void* New(size_t size);
40 40
41 template <typename T> 41 template <typename T>
42 T* NewArray(size_t length) { 42 T* NewArray(size_t length) {
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 void operator delete(void* pointer, Zone* zone) { UNREACHABLE(); } 232 void operator delete(void* pointer, Zone* zone) { UNREACHABLE(); }
233 }; 233 };
234 234
235 typedef base::TemplateHashMapImpl<void*, void*, ZoneAllocationPolicy> 235 typedef base::TemplateHashMapImpl<void*, void*, ZoneAllocationPolicy>
236 ZoneHashMap; 236 ZoneHashMap;
237 237
238 } // namespace internal 238 } // namespace internal
239 } // namespace v8 239 } // namespace v8
240 240
241 #endif // V8_ZONE_ZONE_H_ 241 #endif // V8_ZONE_ZONE_H_
OLDNEW
« no previous file with comments | « src/zone/accounting-allocator.h ('k') | test/fuzzer/fuzzer.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698