From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Thompson, David" Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Add 'bytevector-slice'. Date: Wed, 11 Jan 2023 10:21:31 -0500 Message-ID: References: <20230111150015.10219-1-ludo@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32782"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel , Andy Wingo To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Jan 11 16:23:04 2023 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 1pFcwS-0007qn-9Y for guile-devel@m.gmane-mx.org; Wed, 11 Jan 2023 16:23:04 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFcvX-0008Oa-33; Wed, 11 Jan 2023 10:22:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFcvB-000880-VK for guile-devel@gnu.org; Wed, 11 Jan 2023 10:21:55 -0500 Original-Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFcv9-0002S4-Ip for guile-devel@gnu.org; Wed, 11 Jan 2023 10:21:45 -0500 Original-Received: by mail-qt1-x82a.google.com with SMTP id j15so8503036qtv.4 for ; Wed, 11 Jan 2023 07:21:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=worcester-edu.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rQfTzwWxXzlQ08PDHbAL1nCY+IvEDa7C+NiNC3oMWD4=; b=u1ZaNk1e/dXCbF0r8I1quILHQc+301WepoJxprKTGmUnt6ECJ+Wh+rgwKJjFZ1rFRf flIKXwYU8dMnJJAbxMsw8ky7oBvOnj85jUmQ8kosMhDzDv4L8QSiyVrszx/PE6p1Oj70 3E/V73BLohneK7x7eO6UHkaJfb5kB7bHq7xUpgXpGVGekq81alWJZWj9YVFzoIHlbKNP oLhKiVpYpjyKXxjNHfWfsgvxpkvS1SWghp+LROAi4yHUR2tiZiVWR1h03TxtdbTthouJ pQ3gvVV+r19x9OjvwofL+3XUne10MprXm36c/aIeykSl2nDxM2iDSJkl6edhl7afOoQz v/7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rQfTzwWxXzlQ08PDHbAL1nCY+IvEDa7C+NiNC3oMWD4=; b=kS1iGxfyNh+Zqv2YEyjnYKmSv6jIUCx616OEY1wctrEM6Mu3G01DMXkQro7w2AZ+SE 1Fc6vCw2DHikjyZ9WyOcZCbZmL5t4lUD/Q0ynNWL/vX6Mm7avr/h1zJF1BvFI0DQcBIz /QoBY/VADMN862JVk8G5RCW0kKIj1axaiW/+e/oWQX6nqNZkPRT1tT8SFDLjscmqSE+Y B6DP9ngOnH0FbSEyKElhzyt59Ry4rdKCr4ErLQ/lVAQlCJspiFi4uwbZI+bJi5weTgZP UI6s/X21oWqDNor1XJKvo2BVuQnB0FLVLJD8LYyIUzK2DhnXVegmr9y5hTDhhmGPjExY jlrg== X-Gm-Message-State: AFqh2kr6koAqXPmsSbIai/Y2hUr6fQecvSIuVKP7fUVtpo//0hH0qT0L ENsxpMxZ3Hy3whKaf1HDziYoUv+OLBIu5lMFbVH5YA== X-Google-Smtp-Source: AMrXdXspBNjg7g1uVyDijlgJfrOWl4WrP38SRFTv7qMSqIamR7zevxQzPFVycWico3dhhgzNap+NkpW3z1qsyEpPQRU= X-Received: by 2002:ac8:450f:0:b0:3a7:b44d:bd56 with SMTP id q15-20020ac8450f000000b003a7b44dbd56mr4534277qtn.464.1673450502350; Wed, 11 Jan 2023 07:21:42 -0800 (PST) In-Reply-To: <20230111150015.10219-1-ludo@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::82a; envelope-from=dthompson2@worcester.edu; helo=mail-qt1-x82a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21558 Archived-At: Hi Ludovic, On Wed, Jan 11, 2023 at 10:00 AM Ludovic Court=C3=A8s wrote: > > +@node Bytevector Slices > +@subsubsection Bytevector Slices > + > +@cindex subset, of a bytevector > +@cindex slice, of a bytevector > +@cindex slice, of a uniform vector > +As an extension to the R6RS specification, the @code{(rnrs bytevectors > +gnu)} module provides the @code{bytevector-slice} procedure, which > +returns a bytevector aliasing part of an existing bytevector. > + > +@deffn {Scheme Procedure} bytevector-slice @var{bv} @var{offset} [@var{s= ize}] > +@deffnx {C Function} scm_bytevector_slice (@var{bv}, @var{offset}, @var{= size}) > +Return the slice of @var{bv} starting at @var{offset} and counting > +@var{size} bytes. When @var{size} is omitted, the slice covers all > +of @var{bv} starting from @var{offset}. The returned slice shares > +storage with @var{bv}: changes to the slice are visible in @var{bv} > +and vice-versa. Just wanted to chime in to say that this is a really great new feature! Bytevector slices will be very useful for performance sensitive code that could benefit from using a pre-allocated memory arena. Really really great stuff! Thank you! - Dave