{"action":"created","comment":{"url":"https://api.github.com/repos/WebAssembly/design/pulls/comments/35710276","id":35710276,"diff_hunk":"@@ -154,6 +151,28 @@ by [available resources](Nondeterminism.md)). In the future, to support\n [>4GiB linear memory](FutureFeatures.md#heaps-bigger-than-4gib), support for\n indices with type `int64` will be added.\n \n+### Adjusting memory size and permissions: `mmap`\n+\n+In the MVP the size of linear memory is fixed: The initial size of linear\n+memory will remain unchanged for the life of that WebAssembly module. Later,\n+we will support a limited form of `mmap` which can:\n+\n+  * Allocate pages of memory, in order to increase or decrease\n+    the amount of available memory to the WebAssembly module.\n+  * Adjust the permissions of a page of memory, for example to make\n+    small effective addresses close to `0` behave as if they are\n+    [out-of-bounds](AstSemantics.md#out-of-bounds)\n+    (see [discussion](https://github.com/WebAssembly/design/issues/204)).\n+\n+In addition to the `mmap` operation, applications will also have access to\n+\n+ * `munmap`, to unmap `mmap`ed pages, and\n+ * `mmap_get_page_size`, to detect the proper system page size.","path":"AstSemantics.md","position":null,"original_position":32,"commit_id":"aa38660ef88e733bb4f95e1657a7847289056db7","original_commit_id":"b708c8340d93454c3e99f03574d8ff16dbd6c303","user":{"login":"pizlonator","id":12176955,"avatar_url":"https://avatars.githubusercontent.com/u/12176955?v=3","gravatar_id":"","url":"https://api.github.com/users/pizlonator","html_url":"https://github.com/pizlonator","followers_url":"https://api.github.com/users/pizlonator/followers","following_url":"https://api.github.com/users/pizlonator/following{/other_user}","gists_url":"https://api.github.com/users/pizlonator/gists{/gist_id}","starred_url":"https://api.github.com/users/pizlonator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pizlonator/subscriptions","organizations_url":"https://api.github.com/users/pizlonator/orgs","repos_url":"https://api.github.com/users/pizlonator/repos","events_url":"https://api.github.com/users/pizlonator/events{/privacy}","received_events_url":"https://api.github.com/users/pizlonator/received_events","type":"User","site_admin":false},"body":"\n> On Jul 28, 2015, at 3:37 PM, Alon Zakai <notifications@github.com> wrote:\n> \n> In AstSemantics.md <https://github.com/WebAssembly/design/pull/285#discussion_r35710043>:\n> \n> > +\n> > +In the MVP the size of linear memory is fixed: The initial size of linear\n> > +memory will remain unchanged for the life of that WebAssembly module. Later,\n> > +we will support a limited form of `mmap` which can:\n> > +\n> > +  * Allocate pages of memory, in order to increase or decrease\n> > +    the amount of available memory to the WebAssembly module.\n> > +  * Adjust the permissions of a page of memory, for example to make\n> > +    small effective addresses close to `0` behave as if they are\n> > +    [out-of-bounds](AstSemantics.md#out-of-bounds)\n> > +    (see [discussion](https://github.com/WebAssembly/design/issues/204)).\n> > +\n> > +In addition to the `mmap` operation, applications will also have access to\n> > +\n> > + * `munmap`, to unmap `mmap`ed pages, and\n> > + * `mmap_get_page_size`, to detect the proper system page size.\n> @jfbastien <https://github.com/jfbastien> ok, I pushed an edit about the \"good enough\" aspect.\n> \n> @pizlonator <https://github.com/pizlonator> I might be confused between email and github's interface, but I think @jfbastien <https://github.com/jfbastien> was commenting on the pull here, not responding to your question.\n> \n> \n\nYou’re right!  Sorry.\n\n-Filip\n> Regarding large reservations, I don't think those would be necessary (unless I am missing something?), but page-level protections would be (but they already were necessary in the docs, as they mentioned a way to protect the area around 0).\n> \n> I also wrote a general response in the main thread of this pull.\n> \n> —\n> Reply to this email directly or view it on GitHub <https://github.com/WebAssembly/design/pull/285/files#r35710043>.\n> \n\n","created_at":"2015-07-28T22:40:10Z","updated_at":"2015-07-28T22:40:10Z","html_url":"https://github.com/WebAssembly/design/pull/285#discussion_r35710276","pull_request_url":"https://api.github.com/repos/WebAssembly/design/pulls/285","_links":{"self":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/comments/35710276"},"html":{"href":"https://github.com/WebAssembly/design/pull/285#discussion_r35710276"},"pull_request":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/285"}}},"pull_request":{"url":"https://api.github.com/repos/WebAssembly/design/pulls/285","id":41063213,"html_url":"https://github.com/WebAssembly/design/pull/285","diff_url":"https://github.com/WebAssembly/design/pull/285.diff","patch_url":"https://github.com/WebAssembly/design/pull/285.patch","issue_url":"https://api.github.com/repos/WebAssembly/design/issues/285","number":285,"state":"open","locked":false,"title":"Remove sbrk from MVP, add mmap&friends to AstSemantics","user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"body":"Based on discussion in #227. \r\n\r\nI didn't know how to call the `sysconf`-like method... ideas are welcome.","created_at":"2015-07-28T21:32:39Z","updated_at":"2015-07-28T22:40:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df4694b7fec3f53e44491735be82aa407c5752cd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WebAssembly/design/pulls/285/commits","review_comments_url":"https://api.github.com/repos/WebAssembly/design/pulls/285/comments","review_comment_url":"https://api.github.com/repos/WebAssembly/design/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WebAssembly/design/issues/285/comments","statuses_url":"https://api.github.com/repos/WebAssembly/design/statuses/aa38660ef88e733bb4f95e1657a7847289056db7","head":{"label":"WebAssembly:how-is-linear-memory","ref":"how-is-linear-memory","sha":"aa38660ef88e733bb4f95e1657a7847289056db7","user":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"repo":{"id":34808241,"name":"design","full_name":"WebAssembly/design","owner":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WebAssembly/design","description":"WebAssembly Design Documents","fork":false,"url":"https://api.github.com/repos/WebAssembly/design","forks_url":"https://api.github.com/repos/WebAssembly/design/forks","keys_url":"https://api.github.com/repos/WebAssembly/design/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WebAssembly/design/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WebAssembly/design/teams","hooks_url":"https://api.github.com/repos/WebAssembly/design/hooks","issue_events_url":"https://api.github.com/repos/WebAssembly/design/issues/events{/number}","events_url":"https://api.github.com/repos/WebAssembly/design/events","assignees_url":"https://api.github.com/repos/WebAssembly/design/assignees{/user}","branches_url":"https://api.github.com/repos/WebAssembly/design/branches{/branch}","tags_url":"https://api.github.com/repos/WebAssembly/design/tags","blobs_url":"https://api.github.com/repos/WebAssembly/design/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WebAssembly/design/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WebAssembly/design/git/refs{/sha}","trees_url":"https://api.github.com/repos/WebAssembly/design/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WebAssembly/design/statuses/{sha}","languages_url":"https://api.github.com/repos/WebAssembly/design/languages","stargazers_url":"https://api.github.com/repos/WebAssembly/design/stargazers","contributors_url":"https://api.github.com/repos/WebAssembly/design/contributors","subscribers_url":"https://api.github.com/repos/WebAssembly/design/subscribers","subscription_url":"https://api.github.com/repos/WebAssembly/design/subscription","commits_url":"https://api.github.com/repos/WebAssembly/design/commits{/sha}","git_commits_url":"https://api.github.com/repos/WebAssembly/design/git/commits{/sha}","comments_url":"https://api.github.com/repos/WebAssembly/design/comments{/number}","issue_comment_url":"https://api.github.com/repos/WebAssembly/design/issues/comments{/number}","contents_url":"https://api.github.com/repos/WebAssembly/design/contents/{+path}","compare_url":"https://api.github.com/repos/WebAssembly/design/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WebAssembly/design/merges","archive_url":"https://api.github.com/repos/WebAssembly/design/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WebAssembly/design/downloads","issues_url":"https://api.github.com/repos/WebAssembly/design/issues{/number}","pulls_url":"https://api.github.com/repos/WebAssembly/design/pulls{/number}","milestones_url":"https://api.github.com/repos/WebAssembly/design/milestones{/number}","notifications_url":"https://api.github.com/repos/WebAssembly/design/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WebAssembly/design/labels{/name}","releases_url":"https://api.github.com/repos/WebAssembly/design/releases{/id}","created_at":"2015-04-29T17:36:05Z","updated_at":"2015-07-28T17:17:07Z","pushed_at":"2015-07-28T22:36:00Z","git_url":"git://github.com/WebAssembly/design.git","ssh_url":"git@github.com:WebAssembly/design.git","clone_url":"https://github.com/WebAssembly/design.git","svn_url":"https://github.com/WebAssembly/design","homepage":"","size":3242,"stargazers_count":4075,"watchers_count":4075,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":201,"mirror_url":null,"open_issues_count":60,"forks":201,"open_issues":60,"watchers":4075,"default_branch":"master"}},"base":{"label":"WebAssembly:master","ref":"master","sha":"f74c4a87968ecf73120cc4588e67c7ca06ab170f","user":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"repo":{"id":34808241,"name":"design","full_name":"WebAssembly/design","owner":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WebAssembly/design","description":"WebAssembly Design Documents","fork":false,"url":"https://api.github.com/repos/WebAssembly/design","forks_url":"https://api.github.com/repos/WebAssembly/design/forks","keys_url":"https://api.github.com/repos/WebAssembly/design/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WebAssembly/design/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WebAssembly/design/teams","hooks_url":"https://api.github.com/repos/WebAssembly/design/hooks","issue_events_url":"https://api.github.com/repos/WebAssembly/design/issues/events{/number}","events_url":"https://api.github.com/repos/WebAssembly/design/events","assignees_url":"https://api.github.com/repos/WebAssembly/design/assignees{/user}","branches_url":"https://api.github.com/repos/WebAssembly/design/branches{/branch}","tags_url":"https://api.github.com/repos/WebAssembly/design/tags","blobs_url":"https://api.github.com/repos/WebAssembly/design/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WebAssembly/design/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WebAssembly/design/git/refs{/sha}","trees_url":"https://api.github.com/repos/WebAssembly/design/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WebAssembly/design/statuses/{sha}","languages_url":"https://api.github.com/repos/WebAssembly/design/languages","stargazers_url":"https://api.github.com/repos/WebAssembly/design/stargazers","contributors_url":"https://api.github.com/repos/WebAssembly/design/contributors","subscribers_url":"https://api.github.com/repos/WebAssembly/design/subscribers","subscription_url":"https://api.github.com/repos/WebAssembly/design/subscription","commits_url":"https://api.github.com/repos/WebAssembly/design/commits{/sha}","git_commits_url":"https://api.github.com/repos/WebAssembly/design/git/commits{/sha}","comments_url":"https://api.github.com/repos/WebAssembly/design/comments{/number}","issue_comment_url":"https://api.github.com/repos/WebAssembly/design/issues/comments{/number}","contents_url":"https://api.github.com/repos/WebAssembly/design/contents/{+path}","compare_url":"https://api.github.com/repos/WebAssembly/design/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WebAssembly/design/merges","archive_url":"https://api.github.com/repos/WebAssembly/design/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WebAssembly/design/downloads","issues_url":"https://api.github.com/repos/WebAssembly/design/issues{/number}","pulls_url":"https://api.github.com/repos/WebAssembly/design/pulls{/number}","milestones_url":"https://api.github.com/repos/WebAssembly/design/milestones{/number}","notifications_url":"https://api.github.com/repos/WebAssembly/design/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WebAssembly/design/labels{/name}","releases_url":"https://api.github.com/repos/WebAssembly/design/releases{/id}","created_at":"2015-04-29T17:36:05Z","updated_at":"2015-07-28T17:17:07Z","pushed_at":"2015-07-28T22:36:00Z","git_url":"git://github.com/WebAssembly/design.git","ssh_url":"git@github.com:WebAssembly/design.git","clone_url":"https://github.com/WebAssembly/design.git","svn_url":"https://github.com/WebAssembly/design","homepage":"","size":3242,"stargazers_count":4075,"watchers_count":4075,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":201,"mirror_url":null,"open_issues_count":60,"forks":201,"open_issues":60,"watchers":4075,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/285"},"html":{"href":"https://github.com/WebAssembly/design/pull/285"},"issue":{"href":"https://api.github.com/repos/WebAssembly/design/issues/285"},"comments":{"href":"https://api.github.com/repos/WebAssembly/design/issues/285/comments"},"review_comments":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/285/comments"},"review_comment":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/285/commits"},"statuses":{"href":"https://api.github.com/repos/WebAssembly/design/statuses/aa38660ef88e733bb4f95e1657a7847289056db7"}}}}