3 ms·
> Varnish allocate some virtual memory, it tells the operating system to back this memory with space from a disk file. What's the special instruction to do thi
by sudhirj 5y ago
> Varnish allocate some virtual memory, it tells the operating system to back this memory with space from a disk file.
What's the special instruction to do this? Is this a low level C / syscall thing or do languages like Go have a disk-backed map implementation already?
- ruste 5y agoThis sounds like a backwards description of mmap. This is probably what they're using on the backend. I'm not sure if Windows has this as a feature, but any unixy system will.
- Arnavion 5y agommap on Windows is CreateFileMapping + MapViewOfFile
- KarlKode 5y agoI guess they are refering to mmap (https://man7.org/linux/man-pages/man2/mmap.2.html https://man7.org/linux/man-pages/man2/mmap.2.html). In go you can use the mmap syscall directly (low level, not supported on all targets/OSs). I believe there are a few libraries that offer wrappers around the syscall/emulate the syscall if not available).