[email protected] (Ludovic Courtès) writes:
> Mark H Weaver <[email protected]> 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