Re: mmap for guile

2022-07-21 Thread Ludovic Courtès
Hi, Maxime Devos skribis: > Ludovic Courtès schreef op ma 04-07-2022 om 12:09 [+0200]: >> I don’t think the optimizer makes any such assumption, except for >> literal bytevectors. > > It _does_ assume that bytevector lengths don't change: [...] > As can be seen in the above output, it first de

Re: mmap for guile

2022-07-19 Thread Maxime Devos
Ludovic Courtès schreef op ma 04-07-2022 om 12:09 [+0200]: > I don’t think the optimizer makes any such assumption, except for > literal bytevectors. It _does_ assume that bytevector lengths don't change: ,use (rnrs bytevectors) ,compile (bytevector-u8-ref some-variable 999) ;;; : warning: possi

Re: mmap for guile

2022-07-19 Thread Maxime Devos
Ludovic Courtès schreef op ma 04-07-2022 om 12:09 [+0200]: > But we could provide special semantics: the bytevector would become > zero-length (possible, but weird, as Maxime points out), or it would > be turned into a /dev/zero mapping (weird as well). > > Thoughts? The former is weird and can c

Re: mmap for guile

2022-07-19 Thread Maxime Devos
Ludovic Courtès schreef op ma 04-07-2022 om 12:09 [+0200]: > > Also, what if you mmap a region, use bytevector->pointer and pass > > it to > > some C thing, which saves the pointer somewhere where boehm-gc can > > find > > it and boehm-gc considers it to be live, is there something that > > prevent

Re: mmap for guile

2022-07-05 Thread Greg Troxel
Ludovic Courtès writes: > Greg Troxel skribis: > >> I have been meaning to try to build this under NetBSD, to check >> portability. I think the mmap code should by default rely only on what >> POSIX guarantees: >> https://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html > > Agreed

Re: mmap for guile

2022-07-04 Thread Ludovic Courtès
Hi, Greg Troxel skribis: > Ludovic Courtès writes: > >> Besides what Maxime points out, some more superficial issues: >> >> • In documentation, please refer to the relevant glibc section instead >> of “See man page” (info "(libc) Memory-mapped I/O"). >> >> • Please update doc/ref with a

Re: mmap for guile

2022-07-04 Thread Greg Troxel
Ludovic Courtès writes: > Besides what Maxime points out, some more superficial issues: > > • In documentation, please refer to the relevant glibc section instead > of “See man page” (info "(libc) Memory-mapped I/O"). > > • Please update doc/ref with a section on memory-mapped I/O. > >

Re: mmap for guile

2022-06-26 Thread Maxime Devos
Matt Wette schreef op zo 26-06-2022 om 08:37 [-0700]: > 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

Re: mmap for guile

2022-06-26 Thread Maxime Devos
Some old mmap things that might be useful: * https://lists.nongnu.org/archive/html/guile-devel/2013-04/msg00235.html * https://lists.gnu.org/archive/html/bug-guile/2017-11/msg00033.html * https://lists.gnu.org/archive/html/guile-user/2006-11/msg00013.html +SCM_DEFINE (scm_mmap_search, "mmap/searc

Re: mmap for guile

2022-06-26 Thread Developers list for Guile, the GNU extensibility library
On Sun, 26 Jun 2022, Matt Wette wrote: > flags >(logior MAP_ANON MAP_PRIVATE) Why MAP_ANON instead of MAP_ANONYMOUS. The latter is more clear and you don't have to care about compatibility like C does. Also, does MAP_FIXED or MAP_FIXED_NOREPLACE is passed to `flags' if `(not (

Re: mmap for guile

2022-06-26 Thread Matt Wette
Appologies: link is https://github.com/mwette/guile-contrib/blob/main/patch/3.0.8/mmap-api.patch On 6/26/22 8:37 AM, Matt Wette wrote: 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 u

mmap for guile

2022-06-26 Thread Matt Wette
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.