From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: mmap for guile Date: Sun, 26 Jun 2022 08:37:01 -0700 Message-ID: <56ee7537-1666-3d04-7093-732a75624e9b@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27347"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 To: guile-devel@gnu.org, Guile User Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Jun 26 17:37:50 2022 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o5UKc-0006tV-0S for guile-devel@m.gmane-mx.org; Sun, 26 Jun 2022 17:37:50 +0200 Original-Received: from localhost ([::1]:59004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5UKa-0000qn-SP for guile-devel@m.gmane-mx.org; Sun, 26 Jun 2022 11:37:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5UJx-0000mw-5f; Sun, 26 Jun 2022 11:37:09 -0400 Original-Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:44577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5UJv-00043h-DB; Sun, 26 Jun 2022 11:37:08 -0400 Original-Received: by mail-pj1-x102f.google.com with SMTP id n16-20020a17090ade9000b001ed15b37424so7154517pjv.3; Sun, 26 Jun 2022 08:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:content-language:to:from :subject:content-transfer-encoding; bh=TSkmr2G2N7cGwROhVzGozpy99bjgpHlz9V/jdRXTlIU=; b=fmoTQXO1yEWYaNKyLREec7lr3Tr0qYl8ZSSKQ2Uq0/rrfDl8APG43hM+fUXN2R7oWV 5MIMETgZ8EtP/ygQbd2rx34fSn9YcPhLFH1V2bsVrKdp84wyu1r5giuLG+onvLmRXLOw Bl1H5F59S1j8IHOA3vBYc9z6Ldh+Fy103xQJVyMnE52a+341ZXTsXPgiyCYPWVlaVOms 1BXR01EXD8sEUeGLkuomVig7fxQxUlgcmhpXVhlAnsuz93P7lWNxeSNciRnuCJ9QZCbe 974rDng3obsVNJSOCKHwJRXX/dwQkoLJF/sO9j7pfzi4M5SzSLSaiaSJ2kec2fBJ099E LC4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:from:subject:content-transfer-encoding; bh=TSkmr2G2N7cGwROhVzGozpy99bjgpHlz9V/jdRXTlIU=; b=73BG2x01c1ajvKzwPB2pjvSBTNJSZp8KjxdKvzAn2/YcMoTzCg0ASzmnwBDZy4CAA9 E6u33vbbtxoKxb0Y0MthfhJ5L8zge41tw1SbPtLRls3vgdrRohsnGH1LE9ip3vnQdYpk zMLAuWLik3gIJV1Jhw6eHhJH1/iwqf0mWpZT36Hq7qLqbv05gG2IDWmV8+FmXv6oly2Q 9liVobnOteW6pCWStTmpnfmc5tMxCqtxJ4xLC/8TiqSClFsTgcifv0OILxUqHdzmy7fc fs+f5ZOkmJkABtHEMHXuFJyZ5dlyu3mgvIdbWBJi6HwlBR+090+IYtERIAgUhGb2YZKj edAA== X-Gm-Message-State: AJIora8roQupDd8X1ewrWT79a+ZAOsF0bfVg9yQ6ojSqHibkvIlp0KDz TMwk8jC7Dnm25yuWOiTheO+HmlsBHR4= X-Google-Smtp-Source: AGRyM1tLGmCr6MjCr/N560jBQ3Jf7etloQ02esEaEunMaE8Ayk0jxUkGP/cvc5ZzVpe3i3IcnxLgcA== X-Received: by 2002:a17:902:ed02:b0:169:e40a:7bed with SMTP id b2-20020a170902ed0200b00169e40a7bedmr9536178pld.167.1656257824535; Sun, 26 Jun 2022 08:37:04 -0700 (PDT) Original-Received: from [192.168.2.158] (64-52-176-132.championbroadband.com. [64.52.176.132]) by smtp.gmail.com with ESMTPSA id ms3-20020a17090b234300b001ead46e77e2sm5362229pjb.13.2022.06.26.08.37.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Jun 2022 08:37:03 -0700 (PDT) Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=matt.wette@gmail.com; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:21242 gmane.lisp.guile.user:18343 Archived-At: 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"'.