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: Neil Jerram
Subject: Re: `scm_c_read ()' and `swap_buffer' trick harmful
Date: Sun, 23 Nov 2008 22:30:19 +0000

2008/11/21 Ludovic Courtès <address@hidden>:
> 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.

Hmm.  I agree that this isn't ideal.  I guess it's OK for now though.

> Please commit!

Thanks, doing that now.

       Neil




reply via email to

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