guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `scm_c_read ()' and `swap_buffer' trick harmful


From: Ludovic Courtès
Subject: Re: `scm_c_read ()' and `swap_buffer' trick harmful
Date: Fri, 21 Nov 2008 18:05:48 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

Hi Neil,

"Neil Jerram" <address@hidden> writes:

> 2008/11/20 Ludovic Courtès <address@hidden>:
>>
>> In theory, yes.  In practice, the notion of "unbuffered port" is
>> ill-defined, I'm afraid.  The `SCM_BUF0' flag probably can't be relied
>> on, as it appears to be only really used on `fports.c'.  Actually, for
>> some reason (probably copy & paste), make_cbip() creates ports with
>> "SCM_OPN | SCM_RDNG | SCM_BUF0", although `SCM_BUF0' is probably not
>> needed.  So I think "unbuffered port" means "read_buf_size <= 1".
>
> That's what I was thinking too.  Please see the attached.

Thanks for the quick fix!

I confirm it works with CBIPs in Guile-R6RS-Libs, but I had to make this
small change:

  
http://repo.or.cz/w/guile-r6rs-libs.git?a=commitdiff;h=dfab2fe21f82bc40cfdf9a3a3eeb6936d5935c8c

IOW, with Guile up to 1.8.5, it was harmless to leave `read_buf_size'
uninitialized (actually, zeroed), which was OK since CBIPs don't use it,
but the change in `scm_c_read ()' makes it necessary to initialize it.
It's probably a reasonable expectation, though.

Please commit!

Thanks,
Ludo'.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]