Il Tue, 21 Mar 2017 17:55:31 +0000 Tristan Van Berkom 
<tristan.vanber...@codethink.co.uk> scrisse:

> ...
>   o I believe the lookups with G_TYPE_INSTANCE_GET_PRIVATE() are just
>     as cheap as the pointer dereference (as it will be implemented
>     using simple pointer arithmetic).

Hi Tristan,

the lookup indeed is quite expensive, and looking at the
implementation [1] it is not that straightforward.

The very same example provided by the official documentation [2]
caches that pointer into the instance struct.

[1] https://git.gnome.org/browse/glib/tree/gobject/gtype.c#n4709
[2] 
https://developer.gnome.org/gobject/stable/gobject-Type-Information.html#g-type-class-add-private

Ciao.
-- 
Nicola
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to