[Top][All Lists]

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

Re: fixes to goops + light structs + 'u' slots

From: Ludovic Courtès
Subject: Re: fixes to goops + light structs + 'u' slots
Date: Thu, 10 Apr 2008 23:33:13 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Hi Andy!

Andy Wingo <address@hidden> writes:

> Here are some patches that fix some goops <-> light structs <-> 'u'
> slots interactions. See
> for the basic idea
> of where this goes. I'll write more later, but I think that these fixes
> are obviously correct.

Looks good to me, I applied them (with `git-am', which is a nice tool),
along with `NEWS' entries.

> From: Andy Wingo <address@hidden>

You forgot to set your email address.  :-)

> Subject: [PATCH] respect slot allocation, e.g. for <read-only-slot>
>       * libguile/goops.c (get_slot_value, set_slot_value): In the struct
>       allocation case, don't poke the slots array directly -- we should
>       go through struct-ref/struct-set! code so that we get the
>       permissions and allocation ('u' versus 'p') correct.

This one is of course correct, but I'm concerned about the performance
implications of all this permission checking.  `scm_struct_ref ()' is
not trivial, and it's not inlined, etc.  Maybe some preprocessing could
be made at vtable creation time so that we don't have to reinterpret the
whole layout string at each ref/set?

> * libguile/struct.c (scm_struct_ref, scm_struct_set_x): "Light" structs
> have no hidden words (members of the SCM_STRUCT_DATA(x) array accessed
> with negative indices). In that case, determine the number of fields
> from the length of the struct layout descriptor. (Most GOOPS instances
> are light structs.)

Is there a simple test case that reproduces this?  For instance, are
instances of <class> light structs?


reply via email to

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