Re: avoiding relocations in type registration
- From: "Matthias Clasen" <matthias clasen gmail com>
- To: "Tim Janik" <timj imendio com>
- Cc: Gtk+ Developers <gtk-devel-list gnome org>, Matthias Clasen <mclasen redhat com>
- Subject: Re: avoiding relocations in type registration
- Date: Fri, 21 Apr 2006 09:12:50 -0400
On 4/21/06, Tim Janik <timj imendio com> wrote:
> >
> > GType
> > g_type_register_static_simple (GType parent_type,
> > const gchar *type_name,
> > guint16 class_size,
>
> can you make this a guint instead?
>
> > GClassInitFunc class_init,
> > guint16 instance_size,
>
> and this? i don't think restricting to guint16 here really buys us anything.
sure, I'll change it. I was just copying the types from GTypeInfo.
> >
> > The current trivial implementation fills a GTypeInfo struct on the
> > stack, but it should be possible to avoid the use of a struct
> > altogether.
>
> you mean inside g_type_register_static_simple? i don't see what's
> wrong with the way you did it, i'd leave it as that.
What I meant is that check_type_info_I and type_data_make_W poke all
the fields out of the info struct again; it is not kept around after the node
is constructed. Thus one could avoid setting up the struct in the first place
and pass the fields directly to that check_type_info_I and type_data_make_W.
But 'm fine with keeping the current approach.
Matthias
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]