From 0918d83d23aa421e956dfbcaeefd9faeae94237e Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Wed, 30 Mar 2016 18:11:50 -0500 Subject: Change max to optional and hard --- AstSemantics.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'AstSemantics.md') diff --git a/AstSemantics.md b/AstSemantics.md index cb73c63..9296087 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -202,11 +202,15 @@ Out of bounds accesses trap. In the MVP, linear memory can be resized by a `grow_memory` operator. The operand to this operator is in units of the WebAssembly page size, -which is 64KiB on all engines (though large page support may be added in +which is defined to be 64KiB (though large page support may be added in the [future](FutureFeatures.md#large-page-support)). * `grow_memory` : grow linear memory by a given unsigned delta of pages. - Return the previous memory size in bytes. + Return the previous memory size in units of pages or -1 on failure. + +`grow_memory` must fail when attempting to grow past the maximum declared +size, if one is specified in the [memory section](Module.md#linear-memory-section). +`grow_memory` may also fail if an underlying system allocation fails. As stated [above](AstSemantics.md#linear-memory), linear memory is contiguous, meaning there are no "holes" in the linear address space. After the -- cgit v1.2.3