1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Handing memory the process freed back to the system.
//!
//! Freeing memory gives it back to the allocator, which keeps it for the next
//! allocation instead of returning it: after a mount of a large folder ends, macOS's
//! allocator still holds hundreds of megabytes of freed pages for the process, and
//! glibc's holds some too. Only the allocator can let them go, when asked to.
//!
//! This is the one place sandfs calls code Rust can't check: each call below takes no
//! pointer of ours (a null zone means every zone) and only returns unused pages to the
//! system, so it can't touch memory in use.
/// Ask the allocator to return the memory it holds unused, after a trim or once a mount
/// is gone. Returns the bytes given back, where the allocator says.