Skip to content

Commit

Permalink
[cleanup] Remove dead {AllocatePage} function
Browse files Browse the repository at this point in the history
[email protected]

Bug: v8:9396
Change-Id: If197687b6208257be18f91b4b172ec41600c21b4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1784287
Reviewed-by: Michael Lippautz <[email protected]>
Commit-Queue: Clemens Hammacher <[email protected]>
Cr-Commit-Position: refs/heads/master@{#63555}
  • Loading branch information
backes authored and Commit Bot committed Sep 4, 2019
1 parent eb443e1 commit 2314928
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
10 changes: 0 additions & 10 deletions src/utils/allocation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,6 @@ bool SetPermissions(v8::PageAllocator* page_allocator, void* address,
return page_allocator->SetPermissions(address, size, access);
}

byte* AllocatePage(v8::PageAllocator* page_allocator, void* hint,
size_t* allocated) {
DCHECK_NOT_NULL(page_allocator);
size_t page_size = page_allocator->AllocatePageSize();
void* result = AllocatePages(page_allocator, hint, page_size, page_size,
PageAllocator::kReadWrite);
if (result != nullptr) *allocated = page_size;
return static_cast<byte*>(result);
}

bool OnCriticalMemoryPressure(size_t length) {
// TODO(bbudge) Rework retry logic once embedders implement the more
// informative overload.
Expand Down
9 changes: 1 addition & 8 deletions src/utils/allocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ V8_EXPORT_PRIVATE v8::PageAllocator* SetPlatformPageAllocatorForTesting(
v8::PageAllocator* page_allocator);

// Gets the page granularity for AllocatePages and FreePages. Addresses returned
// by AllocatePages and AllocatePage are aligned to this size.
// by AllocatePages are aligned to this size.
V8_EXPORT_PRIVATE size_t AllocatePageSize();

// Gets the granularity at which the permissions and release calls can be made.
Expand Down Expand Up @@ -142,13 +142,6 @@ inline bool SetPermissions(v8::PageAllocator* page_allocator, Address address,
access);
}

// Convenience function that allocates a single system page with read and write
// permissions. |address| is a hint. Returns the base address of the memory and
// the page size via |allocated| on success. Returns nullptr on failure.
V8_EXPORT_PRIVATE
V8_WARN_UNUSED_RESULT byte* AllocatePage(v8::PageAllocator* page_allocator,
void* address, size_t* allocated);

// Function that may release reserved memory regions to allow failed allocations
// to succeed. |length| is the amount of memory needed. Returns |true| if memory
// could be released, false otherwise.
Expand Down

0 comments on commit 2314928

Please sign in to comment.