After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747882 - gtype: Bump allowed number of children
gtype: Bump allowed number of children
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gobject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-04-15 03:43 UTC by Garrett Regier
Modified: 2015-05-12 12:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtype: Bump allowed number of children (1.09 KB, patch)
2015-04-15 03:45 UTC, Garrett Regier
committed Details | Review

Description Garrett Regier 2015-04-15 03:43:21 UTC
GType currently restricts the number of children to be less than 4095, this is an issue when generating types. This can also be an issue for the Lua bindings as each Lua state will create a new GType each time the Lua is executed.
Comment 1 Garrett Regier 2015-04-15 03:45:44 UTC
Created attachment 301587 [details] [review]
gtype: Bump allowed number of children

Bumps it to G_MAXUINT, the field is a guint.
Comment 2 Matthias Clasen 2015-04-15 13:58:20 UTC
Review of attachment 301587 [details] [review]:

If you look at the bitfield in the TypeNode struct, this was obviously meant to be guint n_children : 12, because then the bitfield would add up to exactly 32. Not sure there's anything to do now, other than bump the limit...
Comment 3 Garrett Regier 2015-04-15 19:15:43 UTC
I could rework the patch to bump the limit less excessively and spread the extra bits to n_supers and n_prerequisites.

Would that be preferred?
Comment 4 Matthias Clasen 2015-04-15 21:49:08 UTC
https://git.gnome.org/browse/glib/commit/?id=ec79146572aece95c7bc032b486e6a57015ee6e4

is the commit that took out the :12
Comment 5 Garrett Regier 2015-04-20 16:26:43 UTC
OK, so cannot reduce the number of bits for this field.

May I push this patch?
Comment 6 Allison Karlitskaya (desrt) 2015-05-12 12:27:14 UTC
Review of attachment 301587 [details] [review]:

Looks fine considering the patch from Benjamin in 2009.