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

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

Issue 2365843002: Revert of Pool implementation for zone segments (Closed)
Patch Set: 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/zone.cc ('k') | src/zone/zone-segment.cc » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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_SEGMENT_H_ 5 #ifndef V8_ZONE_ZONE_SEGMENT_H_
6 #define V8_ZONE_ZONE_SEGMENT_H_ 6 #define V8_ZONE_ZONE_SEGMENT_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 // Segments represent chunks of memory: They have starting address 10 // Segments represent chunks of memory: They have starting address
(...skipping 20 matching lines...) Expand all
31 31
32 Segment* next() const { return next_; } 32 Segment* next() const { return next_; }
33 void set_next(Segment* const next) { next_ = next; } 33 void set_next(Segment* const next) { next_ = next; }
34 34
35 size_t size() const { return size_; } 35 size_t size() const { return size_; }
36 size_t capacity() const { return size_ - sizeof(Segment); } 36 size_t capacity() const { return size_ - sizeof(Segment); }
37 37
38 Address start() const { return address(sizeof(Segment)); } 38 Address start() const { return address(sizeof(Segment)); }
39 Address end() const { return address(size_); } 39 Address end() const { return address(size_); }
40 40
41 // Zap the contents of the segment (but not the header).
42 void ZapContents();
43 // Zaps the header and makes the segment unusable this way.
44 void ZapHeader();
45
46 private: 41 private:
47 #ifdef DEBUG
48 // Constant byte value used for zapping dead memory in debug mode.
49 static const unsigned char kZapDeadByte = 0xcd;
50 #endif
51
52 // Computes the address of the nth byte in this segment. 42 // Computes the address of the nth byte in this segment.
53 Address address(size_t n) const { return Address(this) + n; } 43 Address address(size_t n) const { return Address(this) + n; }
54 44
55 Zone* zone_; 45 Zone* zone_;
56 Segment* next_; 46 Segment* next_;
57 size_t size_; 47 size_t size_;
58 }; 48 };
59 } // namespace internal 49 } // namespace internal
60 } // namespace v8 50 } // namespace v8
61 51
62 #endif // V8_ZONE_ZONE_SEGMENT_H_ 52 #endif // V8_ZONE_ZONE_SEGMENT_H_
OLDNEW
« no previous file with comments | « src/zone/zone.cc ('k') | src/zone/zone-segment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698