@@ -22,17 +22,19 @@ Provide access to safe OS-provided functionality including:
22
22
copies the specified range from ` Blob ` into the range ` [addr, addr+length) `
23
23
(where ` addr+length <= memory_size ` ) but implementations are encouraged
24
24
to ` mmap(addr, length, MAP_FIXED | MAP_PRIVATE, fd) `
25
- * ` dont_need(addr, length) ` : semantically, this operation zeroes the given range
26
- but the implementation is encouraged to ` madvise(addr, length, MADV_DONTNEED) `
27
- (this allows applications to be good citizens and release unused physical
28
- pages back to the OS, thereby reducing their RSS and avoiding OOM-killing on
29
- mobile)
25
+ * ` discard(addr, length) ` : semantically, this operation zeroes the given range
26
+ but the implementation is encouraged to drop the zeroed physical pages from
27
+ the process's working set (e.g., by calling ` madvise(MADV_DONTNEED) ` on
28
+ POSIX)
30
29
* ` shmem_create(length) ` : create a memory object that can be simultaneously
31
30
shared between multiple linear memories
32
31
* ` map_shmem(addr, length, shmem, shmem-offset) ` : like ` map_file ` except
33
32
` MAP_SHARED ` , which isn't otherwise valid on read-only Blobs
34
33
* ` mprotect(addr, length, prot-flags) ` : change protection on the range
35
34
` [addr, addr+length) ` (where ` addr+length <= memory_size ` )
35
+ * ` decommit(addr, length) ` : equivalent to ` mprotect(addr, length, PROT_NONE) `
36
+ followed by ` discard(addr, length) ` and potentially more efficient than
37
+ performing these operations in sequence.
36
38
37
39
The ` addr ` and ` length ` parameters above would be required to be multiples of
38
40
[ ` page_size ` ] ( AstSemantics.md#resizing ) .
0 commit comments