guile-devel
[Top][All Lists]
Advanced

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

Re: thoughts on ports


From: Ludovic Courtès
Subject: Re: thoughts on ports
Date: Fri, 18 Jan 2013 22:27:50 +0100
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

Hi!

Andy Wingo <address@hidden> skribis:

> As a thought experiment, I don't see why things should have to slow
> down.  Master has `scm_c_take_gc_bytevector', which can be used to wrap
> the existing scm_t_port::write_buf, ::read_buf, and ::putback_buf
> members.  At the cost of three allocations per port and three words per
> allocation (bytevector tag, length, and pointer), we could give access
> to these internal buffers to Scheme without affecting the C code at all.
>
> We could go farther and allocate the buffers as bytevectors directly,
> which would entail an additional indirection for C to get at the length
> and data, but the length and data would all be contiguous anyway so in
> practice I don't see it being too bad.

Yes, that seems doable.  What was the initial goal already?

Ludo’.



reply via email to

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