From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: thoughts on ports Date: Fri, 18 Jan 2013 22:27:50 +0100 Message-ID: <871udi41wp.fsf@gnu.org> References: <87zkam7z5n.fsf@pobox.com> <87aa2jqlst.fsf@gnu.org> <87hamfdg9q.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1358544479 16154 80.91.229.3 (18 Jan 2013 21:27:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Jan 2013 21:27:59 +0000 (UTC) Cc: guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 18 22:28:17 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TwJTy-00032R-Pu for guile-devel@m.gmane.org; Fri, 18 Jan 2013 22:28:14 +0100 Original-Received: from localhost ([::1]:59522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwJTh-0002Ni-Hd for guile-devel@m.gmane.org; Fri, 18 Jan 2013 16:27:57 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwJTf-0002Na-5a for guile-devel@gnu.org; Fri, 18 Jan 2013 16:27:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TwJTc-0007gS-OV for guile-devel@gnu.org; Fri, 18 Jan 2013 16:27:55 -0500 Original-Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:48964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwJTc-0007gG-ID for guile-devel@gnu.org; Fri, 18 Jan 2013 16:27:52 -0500 X-IronPort-AV: E=Sophos;i="4.84,495,1355094000"; d="scan'208";a="168969036" Original-Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 18 Jan 2013 22:27:50 +0100 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 29 =?utf-8?Q?Niv=C3=B4se?= an 221 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87hamfdg9q.fsf@pobox.com> (Andy Wingo's message of "Thu, 17 Jan 2013 15:40:33 +0100") User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.105 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15472 Archived-At: Hi! Andy Wingo 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=E2=80=99.