guile-devel
[Top][All Lists]
Advanced

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

Re: Making custom binary input ports unbuffered


From: Mark H Weaver
Subject: Re: Making custom binary input ports unbuffered
Date: Wed, 15 Jan 2014 19:15:46 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Mark H Weaver <address@hidden> skribis:
>
>> While I agree that CBIPs should be unbuffered by default, I think it's
>> important to have a way to enable buffering, even if it's not portable.
>
> So I started with the patch below, which allows us to specify which
> ports (really: which port types) support ‘setvbuf’.  This is
> conservative so that ports that do not explicitly claim to support it
> won’t break.
>
> Then I started modifying the CBIP.  The problem is that the CBIP has a
> bytevector stored in its SCM_STREAM, whose contents are normally stored
> in ‘read_buf’.  So it needs to know if a new buffer is installed.
>
> Perhaps that, rather than a ‘supports_setvbuf’ bit, we need a pointer to
> the port’s ‘setvbuf’ method?  For file ports it would be
> ‘scm_fport_buffer_add’, for instance.

Yes, it sounds like we'll need custom 'setvbuf' methods.
In master, maybe we can move it to scm_t_ptob_descriptor.

    Thanks,
      Mark



reply via email to

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