Re: patch for mmap and friends

2023-01-14 Thread Matt Wette
On 1/14/23 2:42 PM, Maxime Devos wrote:     {   /* Use the fd of the port under clobber protection from concurrency. As scm_dynwind_acquire_port assumes that FILE is a port, check that first. */   SCM_VALIDATE_PORT (SCM_ARG5, file);   scm_dynwind_acquire_port (fil

Re: patch for mmap and friends

2023-01-14 Thread Maxime Devos
On 14-01-2023 23:08, Matt Wette wrote: 2) had to copy/modify dynwind_acquire_port and release_port from ports.c Is it because of the 'static' qualifier? If so, you could use the 'SCM_INTERNAL [...] scm_i_[...]' pattern, e.g. see 'scm_i_is_mutable_bitvector' in libguile/bitvectors.h and li

Re: patch for mmap and friends

2023-01-14 Thread Matt Wette
On 1/14/23 8:31 AM, Matt Wette wrote: On 1/14/23 7:18 AM, Maxime Devos wrote: \ Port objects should be accepted too, as previously asked on . As implied by later comments, using a raw fd causes problems with 'move->fdes'.  Fo

Re: patch for mmap and friends

2023-01-14 Thread tomas
On Sat, Jan 14, 2023 at 04:18:58PM +0100, Maxime Devos wrote: [...] > (While it is recommended for Scheme code to keep a reference to the port to > manually close afterwards, to free resources faster than waiting for GC, it > is not actually required.) Oh, oh. I've got a little anecdote to share

Re: patch for mmap and friends

2023-01-14 Thread Matt Wette
On 1/14/23 7:18 AM, Maxime Devos wrote: \ Port objects should be accepted too, as previously asked on . As implied by later comments, using a raw fd causes problems with 'move->fdes'.  For the remaining response, I'll assume t

Re: [PATCH] Add 'bytevector-slice'.

2023-01-14 Thread Ludovic Courtès
Hello! I pushed the patch as commit e441c34f1666921f6b15597c1aa3a50596a129d7 with the following changes taking into account your comments: • adjusted copyright years; • removed comment about ‘SCM_F_BYTEVECTOR_CONTIGUOUS’ since it’s quite clear from the discussion in this thread that this

Re: patch for mmap and friends

2023-01-14 Thread Maxime Devos
On 14-01-2023 01:49, Matt Wette wrote: Please consider this patch for adding mmap(), munmap() and msync()  to libguile/filesys.c.  Included is update for posix.texi and test file mman.test. Once included, feature 'mman should be #t. Matt + if (SCM_UNBNDP (fd)) +c_fd = -1; + else

Re: [PATCHv2] Extensions for SRFI-171 (Transducers)

2023-01-14 Thread Ludovic Courtès
Hi Colin and all! These patches look like a nice addition. First, you have the option of assigning your copyright for this contribution (and future Guile contributions if you wish) to the FSF, or you can choose not to: https://lists.gnu.org/archive/html/guile-devel/2022-10/msg8.html Pleas

Re: [PATCH] Document R7RS bytevector functions

2023-01-14 Thread Ludovic Courtès
Hi Daniel, lloda skribis: > Right now the manual just mentions (scheme base), but not the contents. This > patch at least makes sure that at least the bytevector-related R7RS functions > appear in the index. > > The patch documents a first group of purely bytevector functions and a second > g

Re: [PATCH] Add 'bytevector-slice'.

2023-01-14 Thread Maxime Devos
On 14-01-2023 00:48, Ludovic Courtès wrote: Ah yes, that’s right, I misunderstood the comment. In the example above, where we’re only dealing with slices, we could “skip” the parent (i.e., have each slice’s parent point to the “root” of the hierarchy), but I don’t think we can assume this to b