Merge branch 'ebassi/no-preallocs' into 'main'

Remove n_preallocs field from InstanceData

See merge request GNOME/glib!3256
This commit is contained in:
Marco Trevisan 2023-02-06 13:33:16 +00:00
commit 5c34cf3dbb
2 changed files with 2 additions and 4 deletions

View File

@ -356,7 +356,6 @@ struct _InstanceData
gpointer class;
guint16 instance_size;
guint16 private_size;
guint16 n_preallocs;
GInstanceInitFunc instance_init;
};
@ -915,7 +914,7 @@ check_type_info_I (TypeNode *pnode,
/* check instance members */
if (!(finfo->type_flags & G_TYPE_FLAG_INSTANTIATABLE) &&
(info->instance_size || info->n_preallocs || info->instance_init))
(info->instance_size || info->instance_init))
{
if (pnode)
g_critical ("cannot instantiate '%s', derived from non-instantiatable parent type '%s'",
@ -1158,7 +1157,6 @@ type_data_make_W (TypeNode *node,
data->instance.class_private_size = 0;
if (pnode)
data->instance.class_private_size = pnode->data->instance.class_private_size;
data->instance.n_preallocs = MIN (info->n_preallocs, 1024);
data->instance.instance_init = info->instance_init;
}
else if (node->is_classed) /* only classed */

View File

@ -1093,7 +1093,7 @@ typedef enum /*< skip >*/
* finalization function for interface types. (optional)
* @class_data: User-supplied data passed to the class init/finalize functions
* @instance_size: Size of the instance (object) structure (required for instantiatable types only)
* @n_preallocs: Prior to GLib 2.10, it specified the number of pre-allocated (cached) instances to reserve memory for (0 indicates no caching). Since GLib 2.10, it is ignored, since instances are allocated with the [slice allocator][glib-Memory-Slices] now.
* @n_preallocs: Prior to GLib 2.10, it specified the number of pre-allocated (cached) instances to reserve memory for (0 indicates no caching). Since GLib 2.10 this field is ignored.
* @instance_init: Location of the instance initialization function (optional, for instantiatable types only)
* @value_table: A #GTypeValueTable function table for generic handling of GValues
* of this type (usually only useful for fundamental types)