【问题标题】:How to memory map a file in Common Lisp on Linux?如何在 Linux 上的 Common Lisp 中内存映射文件?
【发布时间】:2019-11-16 10:20:26
【问题描述】:

如何在 Common Lisp 中通过cffi 或自定义库实现内存映射?

C语言中有void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);

【问题讨论】:

标签: linux common-lisp


【解决方案1】:

已经有How do I memory map tmpfs files in sbcl?,但现在有一个可移植的库:只是(ql:quickload "mmap")

存储库是here

【讨论】:

    【解决方案2】:

    某些实现允许您在调用函数open 时指定文件应该是内存映射的。至少 Allegro CL 支持(open .. :mapped t)。这也适用于扩展为 open 的宏 with-open-file

    【讨论】:

      猜你喜欢
      • 2014-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-01
      相关资源
      最近更新 更多