mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
use g_slic_* for all object allocations.
Thu Dec 1 12:53:26 2005 Tim Janik <timj@imendio.com> * gtype.c: use g_slic_* for all object allocations.
This commit is contained in:
parent
b1b63c4ff3
commit
d871f19c30
@ -1,3 +1,7 @@
|
|||||||
|
Thu Dec 1 12:53:26 2005 Tim Janik <timj@imendio.com>
|
||||||
|
|
||||||
|
* gtype.c: use g_slic_* for all object allocations.
|
||||||
|
|
||||||
2005-11-28 Matthias Clasen <mclasen@redhat.com>
|
2005-11-28 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gobjectnotifyqueue.c (g_object_notify_queue_thaw):
|
* gobjectnotifyqueue.c (g_object_notify_queue_thaw):
|
||||||
|
@ -1544,10 +1544,7 @@ g_type_create_instance (GType type)
|
|||||||
class = g_type_class_ref (type);
|
class = g_type_class_ref (type);
|
||||||
total_size = type_total_instance_size_I (node);
|
total_size = type_total_instance_size_I (node);
|
||||||
|
|
||||||
if (node->data->instance.n_preallocs)
|
instance = g_slice_alloc0 (total_size);
|
||||||
instance = g_slice_alloc0 (total_size);
|
|
||||||
else
|
|
||||||
instance = g_malloc0 (total_size);
|
|
||||||
|
|
||||||
if (node->data->instance.private_size)
|
if (node->data->instance.private_size)
|
||||||
instance_real_class_set (instance, class);
|
instance_real_class_set (instance, class);
|
||||||
@ -1600,10 +1597,7 @@ g_type_free_instance (GTypeInstance *instance)
|
|||||||
#ifdef G_ENABLE_DEBUG
|
#ifdef G_ENABLE_DEBUG
|
||||||
memset (instance, 0xaa, type_total_instance_size_I (node));
|
memset (instance, 0xaa, type_total_instance_size_I (node));
|
||||||
#endif
|
#endif
|
||||||
if (node->data->instance.n_preallocs)
|
g_slice_free1 (type_total_instance_size_I (node), instance);
|
||||||
g_slice_free1 (type_total_instance_size_I (node), instance);
|
|
||||||
else
|
|
||||||
g_free (instance);
|
|
||||||
|
|
||||||
g_type_class_unref (class);
|
g_type_class_unref (class);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user