Index: src/heap/spaces-inl.h |
diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h |
index 0fa4b44104bdb624adf3186aa481eb60f9159d56..cd76fe68ce2d1ec2ca974d754a0ad01ed9a31f9d 100644 |
--- a/src/heap/spaces-inl.h |
+++ b/src/heap/spaces-inl.h |
@@ -446,7 +446,7 @@ |
AllocationResult NewSpace::AllocateRawUnaligned(int size_in_bytes) { |
Address top = allocation_info_.top(); |
- if (allocation_info_.limit() < top + size_in_bytes) { |
+ if (allocation_info_.limit() - top < size_in_bytes) { |
// See if we can create room. |
if (!EnsureAllocation(size_in_bytes, kWordAligned)) { |
return AllocationResult::Retry(); |