mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-09 04:48:05 +02:00
lib: Use slices to allocate cached properties
Saves on memory fragmentation.
This commit is contained in:
parent
4079ba8272
commit
677f2f4da7
1 changed files with 2 additions and 2 deletions
|
|
@ -561,7 +561,7 @@ up_device_set_property (GObject *object, guint prop_id, const GValue *value, GPa
|
|||
if (device->priv->proxy_device == NULL) {
|
||||
GValue *v;
|
||||
|
||||
v = g_new0 (GValue, 1);
|
||||
v = g_slice_new0 (GValue, 1);
|
||||
g_value_init (v, G_VALUE_TYPE (value));
|
||||
g_value_copy (value, v);
|
||||
g_hash_table_insert (device->priv->offline_props, GUINT_TO_POINTER (prop_id), v);
|
||||
|
|
@ -1170,7 +1170,7 @@ static void
|
|||
value_free (GValue *value)
|
||||
{
|
||||
g_value_unset (value);
|
||||
g_free (value);
|
||||
g_slice_free (value);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue