about summary refs log tree commit diff stats
path: root/src/main.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-12-05 20:26:33 +0100
committerbptato <nincsnevem662@gmail.com>2024-12-05 20:37:22 +0100
commitd40ff5b68e93a4210e635215cbe827daff950203 (patch)
tree9cc0c4a2e4f7b4bc0f6b7db681ac4b992e584399 /src/main.nim
parenta3dc167925f7255b35c11f8c7e6607fb6e0d6b52 (diff)
downloadchawan-d40ff5b68e93a4210e635215cbe827daff950203.tar.gz
config, mailcap: remove std/streams dependency, specialize mmap
* use PosixStream/mmap for mailcap reading too; this finally lets us get
  rid of std/streams in the entire codebase
* split up recvDataLoopOrMmap into 3 functions: one that can fall back
  to recvAll, one that falls back to recvDataLoop, and one that does not
  fall back to anything
* use MAP_PRIVATE in mmap for read (we don't care if changes are
  propagated, as we do no changes to cached files)
Diffstat (limited to 'src/main.nim')
-rw-r--r--src/main.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.nim b/src/main.nim
index 3c88ccf2..2840034c 100644
--- a/src/main.nim
+++ b/src/main.nim
@@ -222,7 +222,7 @@ proc initConfig(ctx: ParamParseContext; config: Config;
       ?config.parseConfig(getCurrentDir(), ps.recvAll(), warnings)
       ps.sclose()
   if ps != nil:
-    let src = ps.recvDataLoopOrMmap()
+    let src = ps.recvAllOrMmap()
     ?config.parseConfig(config.dir, src.toOpenArray(), warnings)
     deallocMem(src)
     ps.sclose()