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

Unified Diff: src/heap/spaces.h

Issue 2406913002: [heap] MemoryAllocator: Use size_t consistently (Closed)
Patch Set: Fix compilation 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index 2d5105c67fd41e325932ef514f4a2091ff8cc051..52ca7a52d38482a3d917216e61859ea63f0274e1 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -1237,19 +1237,19 @@ class MemoryAllocator {
kPooledAndQueue,
};
- static int CodePageGuardStartOffset();
+ static size_t CodePageGuardStartOffset();
- static int CodePageGuardSize();
+ static size_t CodePageGuardSize();
- static int CodePageAreaStartOffset();
+ static size_t CodePageAreaStartOffset();
- static int CodePageAreaEndOffset();
+ static size_t CodePageAreaEndOffset();
- static int CodePageAreaSize() {
+ static size_t CodePageAreaSize() {
return CodePageAreaEndOffset() - CodePageAreaStartOffset();
}
- static int PageAreaSize(AllocationSpace space) {
+ static size_t PageAreaSize(AllocationSpace space) {
DCHECK_NE(LO_SPACE, space);
return (space == CODE_SPACE) ? CodePageAreaSize()
: Page::kAllocatableMemory;
@@ -1269,9 +1269,9 @@ class MemoryAllocator {
// should be tried first.
template <MemoryAllocator::AllocationMode alloc_mode = kRegular,
typename SpaceType>
- Page* AllocatePage(intptr_t size, SpaceType* owner, Executability executable);
+ Page* AllocatePage(size_t size, SpaceType* owner, Executability executable);
- LargePage* AllocateLargePage(intptr_t size, LargeObjectSpace* owner,
+ LargePage* AllocateLargePage(size_t size, LargeObjectSpace* owner,
Executability executable);
template <MemoryAllocator::FreeMode mode = kFull>
@@ -1313,8 +1313,7 @@ class MemoryAllocator {
// Returns a MemoryChunk in which the memory region from commit_area_size to
// reserve_area_size of the chunk area is reserved but not committed, it
// could be committed later by calling MemoryChunk::CommitArea.
- MemoryChunk* AllocateChunk(intptr_t reserve_area_size,
- intptr_t commit_area_size,
+ MemoryChunk* AllocateChunk(size_t reserve_area_size, size_t commit_area_size,
Executability executable, Space* space);
void ShrinkChunk(MemoryChunk* chunk, size_t bytes_to_shrink);
@@ -2120,7 +2119,7 @@ class PagedSpace : public Space {
int CountTotalPages();
// Return size of allocatable area on a page in this space.
- inline int AreaSize() { return area_size_; }
+ inline int AreaSize() { return static_cast<int>(area_size_); }
virtual bool is_local() { return false; }
@@ -2183,7 +2182,7 @@ class PagedSpace : public Space {
// Slow path of AllocateRaw. This function is space-dependent.
MUST_USE_RESULT HeapObject* SlowAllocateRaw(int size_in_bytes);
- int area_size_;
+ size_t area_size_;
// Accounting information for this space.
AllocationStats accounting_stats_;
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698