Index: src/heap/spaces-inl.h |
diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h |
index 136dc3b1a3ffc0e0d52c3a264c872c017441fa69..4e436a2e0f0a06c58c4128ffaeeb065bfacbaa78 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(); |