From: Andy Wingo <wingo@pobox.com>
To: "Neil Jerram" <neiljerram@googlemail.com>
Cc: hanwen@xs4all.nl, guile-devel@gnu.org
Subject: Re: Goops & Valgrind
Date: Sun, 04 Jan 2009 13:29:56 +0100 [thread overview]
Message-ID: <m3r63js18b.fsf@pobox.com> (raw)
In-Reply-To: <49dd78620809140506k5f66b7f9i243c4bc9727130eb@mail.gmail.com> (Neil Jerram's message of "Sun, 14 Sep 2008 14:06:58 +0200")
Hi,
Sorry for the spam, but I'm going through some backlog that I didn't
have the resources to deal with. Has this issue been addressed?
Andy
On Sun 14 Sep 2008 14:06, "Neil Jerram" <neiljerram@googlemail.com> writes:
> 2008/9/12 Andy Wingo <wingo@pobox.com>:
>> On Thu 11 Sep 2008 23:06, "Neil Jerram" <neiljerram@googlemail.com> writes:
>>
>>> Are you sure? Surely that would require a call somewhere to
>>> scm_alloc_struct() with n_extra = 0, and I can't see any of those.
>>
>> I'm sure -- goops.c:1541 in master. Doesn't go through scm_alloc_struct
>> at all.
>
> Thanks, I see now.
>
>>> Also, is Mikael right with his error #1? I'm thinking not, because I
>>> believe that instances are structs too, so surely it's OK to call
>>> SCM_STRUCT_DATA (x)[...] on them?
>>
>> I can't recall the mail at the moment. Please reply if you want me to
>> dig through this -- I'm happy to do so. But instances are structs, yes.
>> Calling SCM_STRUCT_DATA (x)[] does work. You have to know how many
>> fields there are, though -- you get that from the vtable.
>
> Agreed. So I think the right fix here is along the lines of your
> second suggestion:
>
>> #define SCM_NUMBER_OF_FIELDS(x) (SCM_STRUCT_VTABLE (x)[scm_si_nfields])
>
> I propose specifically that we:
>
> - remove the SCM_NUMBER_OF_SLOTS macro - because it's never been
> right, so there can't be external code relying on it
>
> - change scm_sys_fast_slot_ref and scm_sys_fast_slot_set_x to say
>
> i = scm_to_unsigned_integer (index, 0, SCM_SLOT (SCM_CLASS_OF (obj),
> scm_si_nfields) - 1);
>
> OK? (There are way too many goops/struct macros already, so let's not
> introduce another one!)
>
> One last concern, though: I didn't understand what you meant by "would
> probably have a different purpose". (In:
>
>> assumption. The other would be to use a different definition of
>> SCM_NUMBER_OF SLOTS, which would probably have a different purpose:
>
> )
>
> Regards,
> Neil
--
http://wingolog.org/
next prev parent reply other threads:[~2009-01-04 12:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-16 5:15 Goops & Valgrind Han-Wen Nienhuys
2008-08-18 15:50 ` Ludovic Courtès
2008-08-19 8:58 ` Han-Wen Nienhuys
2008-08-18 18:58 ` Andy Wingo
2008-08-22 19:00 ` Ludovic Courtès
2008-09-11 21:06 ` Neil Jerram
2008-09-12 19:22 ` Andy Wingo
2008-09-14 12:06 ` Neil Jerram
2008-09-14 17:03 ` Neil Jerram
2009-01-04 12:29 ` Andy Wingo [this message]
2009-01-04 21:01 ` Neil Jerram
2009-01-04 23:36 ` Neil Jerram
2008-09-16 7:25 ` Mikael Djurfeldt
2008-09-16 9:29 ` Neil Jerram
2008-08-19 11:53 ` Mikael Djurfeldt
2008-08-19 15:19 ` Han-Wen Nienhuys
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3r63js18b.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=guile-devel@gnu.org \
--cc=hanwen@xs4all.nl \
--cc=neiljerram@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).