[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
mmap for guile
From: |
Matt Wette |
Subject: |
mmap for guile |
Date: |
Sun, 26 Jun 2022 08:37:01 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 |
I have a candidate mmap implementation for guile (3.0.8) in
github.com/mwette/guile-contrib/patch/3.0.8/mmap-api.patch
It probably needs some review and update. Maybe windows mmap-file would be
nice.
I'm not sure I updated the configure correctly but --disable-mmap-api should
remove.
It exposes features 'mmap-api and 'mmap-file.
scheme@(guile-user)> ,d mmap
- Scheme Procedure: mmap addr len [prot [flags [fd [offset]]]]
See the man page. Returns a bytevector. Note that the region
returned by mmap will NOT be searched by the garbage collector for
pointers. See also mmap/search. Defaults are:
prot
(logior PROT_READ PROT_WRITE)
flags
(logior MAP_ANON MAP_PRIVATE)
fd
-1
offset
0
scheme@(guile-user)> ,d mmap/search
- Scheme Procedure: mmap/search addr len [prot [flags [fd [offset]]]]
See the unix man page for mmap. Returns a bytevector. Note that
the region allocated will be searched by the garbage collector for
pointers. Defaults:
prot
(logior PROT_READ PROT_WRITE)
flags
(logior MAP_ANON MAP_PRIVATE)
fd
-1
offset
0
scheme@(guile-user)> ,d mmap-file
- Scheme Procedure: mmap-file file [prot]
This procedure accepts a file in the form of filename, file-port or
fd. It returns a bytevector. It must not contain scheme allocated
objects as it will not be searched for pointers. Default PROT is
`"r"'.
- mmap for guile,
Matt Wette <=