Reputation: 28
How can I achieve memory mapping in Common Lisp either through cffi
or a custom library?
There is void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
in C language.
Upvotes: 1
Views: 679
Reputation: 816
Some implementations let you specify in a call to function open
take the file should be memory-mapped. At least Allegro CL supports (open .. :mapped t)
. This also works in macro with-open-file
which expands into open
.
Upvotes: 1
Reputation: 51501
There is already How do I memory map tmpfs files in sbcl?, but nowadays there is a portable library for that: just (ql:quickload "mmap")
.
The repository is here.
Upvotes: 7