From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: struct displacements Date: Mon, 25 Jan 2010 15:55:27 +0100 Message-ID: References: <87ljfms3hm.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1264431695 16765 80.91.229.12 (25 Jan 2010 15:01:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Jan 2010 15:01:35 +0000 (UTC) Cc: guile-devel To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jan 25 16:01:27 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NZQRI-0005ph-NU for guile-devel@m.gmane.org; Mon, 25 Jan 2010 16:01:17 +0100 Original-Received: from localhost ([127.0.0.1]:48349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZQRJ-0004dF-UX for guile-devel@m.gmane.org; Mon, 25 Jan 2010 10:01:17 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZQKT-0004Pi-NZ for guile-devel@gnu.org; Mon, 25 Jan 2010 09:54:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZQKP-0004JX-09 for guile-devel@gnu.org; Mon, 25 Jan 2010 09:54:13 -0500 Original-Received: from [199.232.76.173] (port=50995 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZQKO-0004JC-Qw for guile-devel@gnu.org; Mon, 25 Jan 2010 09:54:08 -0500 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:63524 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZQKM-0006ni-Og; Mon, 25 Jan 2010 09:54:06 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 574269406E; Mon, 25 Jan 2010 09:54:06 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=ydpJHiy+xhgz 92DtHa+gMPgRjjY=; b=qK2iVt4C5aH4eLfHDAaUAF+K01ve3bcw0XV8l9sJ6kn5 GN4Vc02GC34UYkongFsC323Gv25OLxnuq+EFVhRCqBAdz8YFbgfQMTdPxiaIydAB beZfWh1Ex5/FrQlYre80gy0D+FxMpRyzSzRVgiN0R9eAc9ttFj3qgPeMvKKGtNg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=xLcRs2 4O72uzBO9lj/xknpYD7bBkkIwn+XvbiAuTHad1Lqay3yS7QS/xOVvJQ/BFU+29J8 2G6+iYBw1C5jLFot0P6UJpFMNcLN9xxt0MFTqKRNKKOt3YqhiRoFUfiTM1dIgeFt yVYhqq7A0zUeaQrg0R/Z2jf44KZHHn1WtjrpE= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 40D7C9406D; Mon, 25 Jan 2010 09:54:05 -0500 (EST) Original-Received: from unquote (unknown [83.202.21.79]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 97FA69406C; Mon, 25 Jan 2010 09:54:03 -0500 (EST) In-Reply-To: <87ljfms3hm.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 25 Jan 2010 14:44:53 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: 7BA6B1EE-09C1-11DF-9BBD-6AF7ED7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9922 Archived-At: Hi Ludo' :) On Mon 25 Jan 2010 14:44, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Andy Wingo writes: > >> - GC_REGISTER_DISPLACEMENT (2*sizeof(scm_t_bits)); /* for the self = data pointer */ >> - GC_REGISTER_DISPLACEMENT (2*sizeof(scm_t_bits) >> - + scm_tc3_struct); /* for the vtable da= ta pointer */ >> + /* The first word of a struct is equal to `SCM_STRUCT_DATA (vtabl= e) + >> + scm_tc3_struct', and `SCM_STRUCT_DATA (vtable)' is 2 words aft= er VTABLE by >> + default. */ >> + GC_REGISTER_DISPLACEMENT (2 * sizeof (scm_t_bits) + scm_tc3_struc= t); >> >> I'm pretty sure the first case is still needed, for instance >> reallocation. It is, as the comment indicates, "for the self data >> pointer" -- the second word of the object, which normally points to the >> third word of the object, but for reallocated instances points to the >> third word of *another* object. > > As an excuse, the comment was a bit too terse for me to understand, but > I get your point now. However, it=E2=80=99s still unclear to me how an = =E2=80=98s=E2=80=99 > field can point to something else than =E2=80=9Cself=E2=80=9D. Hm, I think you're right; the wording was not only terse but misleading. It is "for the data pointer, which might point to another object's data", or something like that. Nothing to do with `s' fields. >> See my article on redefining classes for more info. > > By =E2=80=98self=E2=80=99 here, did you mean what=E2=80=99s known as =E2= =80=98data=E2=80=99 on the diagrams at > ? Yes indeed. > PS: It would be really cool if this blog post were part of the =E2=80=9CD= ata > Representation=E2=80=9D node of the manual. :-) Heh, yeah. That whole chapter needs revision... Andy --=20 http://wingolog.org/