diff --git a/vyper/codegen/memory_allocator.py b/vyper/codegen/memory_allocator.py index 6d202ab36a..e444f4577e 100644 --- a/vyper/codegen/memory_allocator.py +++ b/vyper/codegen/memory_allocator.py @@ -46,6 +46,8 @@ class MemoryAllocator: next_mem: int + _ALLOCATION_LIMIT: int = 2**64 + def __init__(self, start_position: int = MemoryPositions.RESERVED_MEMORY): """ Initializer. @@ -111,10 +113,11 @@ def _expand_memory(self, size: int) -> int: self.next_mem += size self.size_of_mem = max(self.size_of_mem, self.next_mem) - if self.size_of_mem >= 2**64: + if self.size_of_mem >= self._ALLOCATION_LIMIT: # this should not be caught raise MemoryAllocationException( - "Tried to allocate {self.size_of_mem} bytes! (limit is 2**32 bytes)" + f"Tried to allocate {self.size_of_mem} bytes! " + f"(limit is 2**64 bytes)" ) return before_value