Skip to content

Commit

Permalink
Merge pull request #296 from WebAssembly/constrain-page-size
Browse files Browse the repository at this point in the history
Elaborate on the semantics of `page_size`.
  • Loading branch information
jfbastien committed Sep 17, 2015
2 parents 47d9ffa + 618fc54 commit babaf50
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion AstSemantics.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,21 @@ page size. To determine page size, a nullary `page_size` operation is provided.

* `resize_memory` : grow or shrink linear memory by a given delta which
must be a multiple of `page_size`
* `page_size` : nullary constant function returning page size
* `page_size` : nullary constant function returning page size in bytes

Also as stated [above](AstSemantics.md#linear-memory), linear memory is
contiguous, meaning there are no "holes" in the linear address space. After the
MVP, there are [future features](FutureFeatures.md#finer-grained-control-over-memory)
proposed to allow setting protection and creating mappings within the
contiguous linear memory.

The result type of `page_size` is `int32` for wasm32 and `int64` for wasm64.
The result value of `page_size` is an unsigned integer which is a power of 2.

(Note that the `page_size` value need not reflect the actual internal page size
of the implementation; it just needs to be a value suitable for use with
`resize_memory`)

## Local variables

Each function has a fixed, pre-declared number of local variables which occupy a single
Expand Down

0 comments on commit babaf50

Please sign in to comment.