about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-01-07 00:33:52 -0500
committerJune McEnroe <june@causal.agency>2019-01-07 00:33:52 -0500
commit5e1eef754cb3a09f083577d3e934af583a56337d (patch)
tree6e2b53b9bac6af5fe58fed335b2b4a57e0a14974
parentAdd license notice to explore JavaScript (diff)
downloadtorus-5e1eef754cb3a09f083577d3e934af583a56337d.tar.gz
torus-5e1eef754cb3a09f083577d3e934af583a56337d.zip
madvise MADV_NOCORE in image
Diffstat (limited to '')
-rw-r--r--image.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/image.c b/image.c
index 2cfc340..de27349 100644
--- a/image.c
+++ b/image.c
@@ -119,6 +119,11 @@ static void tilesMap(const char *path) {
 
 	error = madvise(tiles, TilesSize, MADV_RANDOM);
 	if (error) err(EX_OSERR, "madvise");
+
+#ifdef MADV_NOCORE
+	error = madvise(tiles, TilesSize, MADV_NOCORE);
+	if (error) err(EX_OSERR, "madvise");
+#endif
 }
 
 static void render(FILE *stream, uint32_t tileX, uint32_t tileY) {