girepository: Use single-bit sized elements for the GIIrNode structures

Leave to the compiler some more hints to optimize these structures for
being packed when possible.
This commit is contained in:
Marco Trevisan (Treviño) 2023-12-21 02:39:52 +01:00
parent e9bdbfaf4b
commit 6cc655f86e

View File

@ -92,16 +92,16 @@ struct _GIIrNodeFunction
{ {
GIIrNode node; GIIrNode node;
gboolean deprecated; uint8_t deprecated : 1;
gboolean is_varargs; /* Not in typelib yet */ uint8_t is_varargs : 1; /* Not in typelib yet */
gboolean is_method; uint8_t is_method : 1;
gboolean is_setter; uint8_t is_setter : 1;
gboolean is_getter; uint8_t is_getter : 1;
gboolean is_constructor; uint8_t is_constructor : 1;
gboolean wraps_vfunc; uint8_t wraps_vfunc : 1;
gboolean throws; uint8_t throws : 1;
gboolean instance_transfer_full; uint8_t instance_transfer_full : 1;
char *symbol; char *symbol;
char *property; char *property;
@ -114,22 +114,22 @@ struct _GIIrNodeType
{ {
GIIrNode node; GIIrNode node;
gboolean is_pointer; uint8_t is_pointer : 1;
gboolean is_basic; uint8_t is_basic : 1;
gboolean is_array; uint8_t is_array : 1;
gboolean is_glist; uint8_t is_glist : 1;
gboolean is_gslist; uint8_t is_gslist : 1;
gboolean is_ghashtable; uint8_t is_ghashtable : 1;
gboolean is_interface; uint8_t is_interface : 1;
gboolean is_error; uint8_t is_error : 1;
int tag; int tag;
char *unparsed; char *unparsed;
gboolean zero_terminated; uint8_t zero_terminated : 1;
gboolean has_length; uint8_t has_length : 1;
int length; int length;
gboolean has_size; uint8_t has_size : 1;
int size; int size;
int array_type; int array_type;
@ -144,16 +144,16 @@ struct _GIIrNodeParam
{ {
GIIrNode node; GIIrNode node;
gboolean in; uint8_t in : 1;
gboolean out; uint8_t out : 1;
gboolean caller_allocates; uint8_t caller_allocates : 1;
gboolean optional; uint8_t optional : 1;
gboolean retval; uint8_t retval : 1;
gboolean nullable; uint8_t nullable : 1;
gboolean skip; uint8_t skip : 1;
gboolean transfer; uint8_t transfer : 1;
gboolean shallow_transfer; uint8_t shallow_transfer : 1;
GIScopeType scope; GIScopeType scope : 3;
int8_t closure; int8_t closure;
int8_t destroy; int8_t destroy;
@ -165,15 +165,15 @@ struct _GIIrNodeProperty
{ {
GIIrNode node; GIIrNode node;
gboolean deprecated; uint8_t deprecated : 1;
char *name; char *name;
gboolean readable; uint8_t readable : 1;
gboolean writable; uint8_t writable : 1;
gboolean construct; uint8_t construct : 1;
gboolean construct_only; uint8_t construct_only : 1;
gboolean transfer; uint8_t transfer : 1;
gboolean shallow_transfer; uint8_t shallow_transfer : 1;
char *setter; char *setter;
char *getter; char *getter;
@ -185,19 +185,19 @@ struct _GIIrNodeSignal
{ {
GIIrNode node; GIIrNode node;
gboolean deprecated; uint8_t deprecated : 1;
gboolean run_first; uint8_t run_first : 1;
gboolean run_last; uint8_t run_last : 1;
gboolean run_cleanup; uint8_t run_cleanup : 1;
gboolean no_recurse; uint8_t no_recurse : 1;
gboolean detailed; uint8_t detailed : 1;
gboolean action; uint8_t action : 1;
gboolean no_hooks; uint8_t no_hooks : 1;
gboolean instance_transfer_full; uint8_t instance_transfer_full : 1;
gboolean has_class_closure; uint8_t has_class_closure : 1;
gboolean true_stops_emit; uint8_t true_stops_emit : 1;
int class_closure; int class_closure;
@ -209,13 +209,13 @@ struct _GIIrNodeVFunc
{ {
GIIrNode node; GIIrNode node;
gboolean is_varargs; /* Not in typelib yet */ uint8_t is_varargs : 1; /* Not in typelib yet */
gboolean must_chain_up; uint8_t must_chain_up : 1;
gboolean must_be_implemented; uint8_t must_be_implemented : 1;
gboolean must_not_be_implemented; uint8_t must_not_be_implemented : 1;
gboolean is_class_closure; uint8_t is_class_closure : 1;
gboolean throws; uint8_t throws : 1;
gboolean instance_transfer_full; uint8_t instance_transfer_full : 1;
char *invoker; char *invoker;
@ -229,8 +229,8 @@ struct _GIIrNodeField
{ {
GIIrNode node; GIIrNode node;
gboolean readable; uint8_t readable : 1;
gboolean writable; uint8_t writable : 1;
int bits; int bits;
int offset; int offset;
GIIrNodeFunction *callback; GIIrNodeFunction *callback;
@ -242,10 +242,10 @@ struct _GIIrNodeInterface
{ {
GIIrNode node; GIIrNode node;
gboolean abstract; uint8_t abstract : 1;
gboolean deprecated; uint8_t deprecated : 1;
gboolean fundamental; uint8_t fundamental : 1;
gboolean final_; uint8_t final_ : 1;
char *gtype_name; char *gtype_name;
char *gtype_init; char *gtype_init;
@ -271,7 +271,7 @@ struct _GIIrNodeValue
{ {
GIIrNode node; GIIrNode node;
gboolean deprecated; uint8_t deprecated : 1;
int64_t value; int64_t value;
}; };
@ -280,7 +280,7 @@ struct _GIIrNodeConstant
{ {
GIIrNode node; GIIrNode node;
gboolean deprecated; uint8_t deprecated : 1;
GIIrNodeType *type; GIIrNodeType *type;
@ -291,7 +291,7 @@ struct _GIIrNodeEnum
{ {
GIIrNode node; GIIrNode node;
gboolean deprecated; uint8_t deprecated : 1;
int storage_type; int storage_type;
char *gtype_name; char *gtype_name;
@ -306,7 +306,7 @@ struct _GIIrNodeBoxed
{ {
GIIrNode node; GIIrNode node;
gboolean deprecated; uint8_t deprecated : 1;
char *gtype_name; char *gtype_name;
char *gtype_init; char *gtype_init;
@ -321,12 +321,12 @@ struct _GIIrNodeStruct
{ {
GIIrNode node; GIIrNode node;
gboolean deprecated; uint8_t deprecated : 1;
gboolean disguised; uint8_t disguised : 1;
gboolean opaque; uint8_t opaque : 1;
gboolean pointer; uint8_t pointer : 1;
gboolean is_gtype_struct; uint8_t is_gtype_struct : 1;
gboolean foreign; uint8_t foreign : 1;
char *gtype_name; char *gtype_name;
char *gtype_init; char *gtype_init;
@ -344,7 +344,7 @@ struct _GIIrNodeUnion
{ {
GIIrNode node; GIIrNode node;
gboolean deprecated; uint8_t deprecated : 1;
GList *members; GList *members;
GList *discriminators; GList *discriminators;