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

Unified Diff: src/heap/spaces.h

Issue 1138643005: Clean-up aligned allocation logic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/mark-compact.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 7ea318d3fa2a4e31c5377918e4561431e1ba4ac8..b1a8c5135d9698dfd17c6a6b57ba80ec8b5dc75f 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -1764,13 +1764,19 @@ class PagedSpace : public Space {
// Allocate the requested number of bytes in the space if possible, return a
// failure object if not.
- MUST_USE_RESULT inline AllocationResult AllocateRaw(int size_in_bytes);
+ MUST_USE_RESULT inline AllocationResult AllocateRawUnaligned(
+ int size_in_bytes);
// Allocate the requested number of bytes in the space double aligned if
// possible, return a failure object if not.
MUST_USE_RESULT inline AllocationResult AllocateRawAligned(
int size_in_bytes, AllocationAlignment alignment);
+ // Allocate the requested number of bytes in the space and consider allocation
+ // alignment if needed.
+ MUST_USE_RESULT inline AllocationResult AllocateRaw(
+ int size_in_bytes, AllocationAlignment alignment);
+
// Give a block of memory to the space's free list. It might be added to
// the free list or accounted as waste.
// If add_to_freelist is false then just accounting stats are updated and
@@ -2501,7 +2507,11 @@ class NewSpace : public Space {
MUST_USE_RESULT INLINE(AllocationResult AllocateRawAligned(
int size_in_bytes, AllocationAlignment alignment));
- MUST_USE_RESULT INLINE(AllocationResult AllocateRaw(int size_in_bytes));
+ MUST_USE_RESULT INLINE(
+ AllocationResult AllocateRawUnaligned(int size_in_bytes));
+
+ MUST_USE_RESULT INLINE(AllocationResult AllocateRaw(
+ int size_in_bytes, AllocationAlignment alignment));
// Reset the allocation pointer to the beginning of the active semispace.
void ResetAllocationInfo();
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698