diff options
author | Eric Wong <e@80x24.org> | 2022-11-30 21:08:37 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2022-12-02 10:09:49 +0000 |
commit | 4fb41eb9e5eea9b959162ba2dab392429af9bd0e (patch) | |
tree | 819b934421f9a51214622f70362eb6198770925c | |
parent | f84a516cdb3cebae0a43846cc95ec2426f67b685 (diff) | |
download | mwrap-4fb41eb9e5eea9b959162ba2dab392429af9bd0e.tar.gz |
Since Linux maps are file-backed, it won't provide an increase in physical memory. Using larger chunks reduces syscalls and avoids hitting the Linux system-wide /proc/sys/vm/max_map_count limit. It's probably safe for all x86-64 systems these days, and 32-bit is prone to overflow and not a target of this project (though this project aims to make other projects suitable for underpowered 32-bit systems).
-rw-r--r-- | mymalloc.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -29,6 +29,9 @@ #include <fcntl.h> #include <errno.h> +/* this is fine on most x86-64, especially with file-backed mmap(2) */ +#define DEFAULT_GRANULARITY (64U * 1024U * 1024U) + #if !defined(MWRAP_FILE_BACKED) && defined(__linux__) && defined(O_TMPFILE) # define MWRAP_FILE_BACKED 1 #else |