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

Unified Diff: src/base/platform/platform.h

Issue 2299753002: Made zone segments aligned in memory and included a pointer to the zone in the header. Larger objec…
Patch Set: Reaction to comments Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: src/base/platform/platform.h
diff --git a/src/base/platform/platform.h b/src/base/platform/platform.h
index d3b6c9c1cf3d758276ccc39c50a20b51fc9f9f98..93d8d2cce2ab006150d286e2e406dd591adb2c1d 100644
--- a/src/base/platform/platform.h
+++ b/src/base/platform/platform.h
@@ -295,8 +295,7 @@ class VirtualMemory {
explicit VirtualMemory(size_t size);
// Reserves virtual memory containing an area of the given size that
- // is aligned per alignment. This may not be at the position returned
- // by address().
+ // is aligned per alignment.
VirtualMemory(size_t size, size_t alignment);
// Construct a virtual memory by assigning it some already mapped address
@@ -308,25 +307,20 @@ class VirtualMemory {
~VirtualMemory();
// Returns whether the memory has been reserved.
- bool IsReserved();
+ bool IsReserved() const;
// Initialize or resets an embedded VirtualMemory object.
void Reset();
// Returns the start address of the reserved memory.
- // If the memory was reserved with an alignment, this address is not
- // necessarily aligned. The user might need to round it up to a multiple of
- // the alignment to get the start of the aligned block.
- void* address() {
+ void* address() const {
DCHECK(IsReserved());
return address_;
}
// Returns the size of the reserved memory. The returned value is only
// meaningful when IsReserved() returns true.
- // If the memory was reserved with an alignment, this size may be larger
- // than the requested size.
- size_t size() { return size_; }
+ size_t size() const { return size_; }
// Commits real memory. Returns whether the operation succeeded.
bool Commit(void* address, size_t size, bool is_executable);
« no previous file with comments | « src/base/accounting-allocator.cc ('k') | src/base/platform/platform-aix.cc » ('j') | src/zone.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698