From: Olivier Dion via General Guile related discussions <guile-user@gnu.org>
To: Maxime Devos <maximedevos@telenet.be>,
Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>,
guile-user@gnu.org
Subject: Re: Question about an error with ports
Date: Fri, 11 Mar 2022 10:06:09 -0500 [thread overview]
Message-ID: <87a6dwbkbi.fsf@laura> (raw)
In-Reply-To: <fe924851abe17c31de36bc906456ba791dd67c8c.camel@telenet.be>
On Fri, 11 Mar 2022, Maxime Devos <maximedevos@telenet.be> wrote:
> Olivier Dion via General Guile related discussions schreef op do 10-03-
> 2022 om 18:46 [-0500]:
>> I haven't check the implementation details, but I think it's just a
>> question of buffering. `get-bytevector-n` will block just like
>> `get-bytevector-some` when the port is empty. The former will return up
>> to N bytes and the latter might return more than N bytes.
>
> I don't think that get-bytevector-some can return more, and it could
> return less:
>
> Return either [...] or a new bytevector containing some of the
> available bytes (at least one),
More or less is relative to the N value compared with get-bytevector-n.
So realy the `some` value is unknown. You just know you will have at
least a byte yes.
> Also, gnunet-scheme depends on the behaviour of it (*) being able to
> return less without blocking (in gnu/gnunet/utils/tokeniser.scm). If
> the behaviour was different, there would have been many test failures.
>
> (*) actually, it uses the variant 'get-bytevector-some!' instead of
> 'get-bytevector-some'.
Re-using the same vector would certainly reduce memory
usage/fragmentation I suppose. Internally, the latter use the former I
think.
Regards,
old
--
Olivier Dion
Polymtl
prev parent reply other threads:[~2022-03-11 15:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 1:26 Question about an error with ports Zelphir Kaltstahl
2022-03-10 15:05 ` Olivier Dion via General Guile related discussions
2022-03-10 22:32 ` Zelphir Kaltstahl
2022-03-10 23:46 ` Olivier Dion via General Guile related discussions
2022-03-11 12:05 ` Chris Vine
2022-03-11 14:58 ` Olivier Dion via General Guile related discussions
2022-03-11 17:26 ` Chris Vine
2022-03-11 17:47 ` Olivier Dion via General Guile related discussions
2022-03-11 18:13 ` Chris Vine
2022-03-11 19:48 ` Maxime Devos
2022-03-11 19:49 ` Maxime Devos
2022-03-12 0:10 ` Chris Vine
2022-03-12 0:27 ` Chris Vine
2022-03-11 12:11 ` Maxime Devos
2022-03-11 15:06 ` Olivier Dion via General Guile related discussions [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6dwbkbi.fsf@laura \
--to=guile-user@gnu.org \
--cc=maximedevos@telenet.be \
--cc=olivier.dion@polymtl.ca \
--cc=zelphirkaltstahl@posteo.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).