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

Unified Diff: src/heap/spaces-inl.h

Issue 2591433002: [heap] Make aligned allocations in black areas completely black. (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces-inl.h
diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h
index aefab10cd1bc5fc7de9643c4b1c55ff4a027f1ba..2079a80a0b00f0130aea154d0e873f7d5dbfcce1 100644
--- a/src/heap/spaces-inl.h
+++ b/src/heap/spaces-inl.h
@@ -471,18 +471,20 @@ AllocationResult PagedSpace::AllocateRawAligned(int size_in_bytes,
object = free_list_.Allocate(allocation_size);
if (object == NULL) {
object = SlowAllocateRaw(allocation_size);
- if (object != NULL && heap()->incremental_marking()->black_allocation()) {
+ }
+ if (object != NULL) {
+ if (heap()->incremental_marking()->black_allocation()) {
Address start = object->address();
- Address end = object->address() + size_in_bytes;
+ Address end = object->address() + allocation_size;
Page::FromAllocationAreaAddress(start)->CreateBlackArea(start, end);
}
- }
- if (object != NULL && filler_size != 0) {
- object = heap()->AlignWithFiller(object, size_in_bytes, allocation_size,
- alignment);
- // Filler objects are initialized, so mark only the aligned object memory
- // as uninitialized.
- allocation_size = size_in_bytes;
+ if (filler_size != 0) {
+ object = heap()->AlignWithFiller(object, size_in_bytes, allocation_size,
+ alignment);
+ // Filler objects are initialized, so mark only the aligned object
+ // memory as uninitialized.
+ allocation_size = size_in_bytes;
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698