[glib/gobject-speedups: 6/13] Don't copy values during g_object_set
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/gobject-speedups: 6/13] Don't copy values during g_object_set
- Date: Sat, 21 May 2022 11:30:38 +0000 (UTC)
commit bc9e84abbfb732263aa011f9aeaf15dc326b9d60
Author: Matthias Clasen <mclasen redhat com>
Date: Sun May 15 07:55:22 2022 -0400
Don't copy values during g_object_set
It is safe not to copy arguments when we are
setting properties. This matches what we do
for g_object_new now.
gobject/gobject.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 44061fc4db..7d79c176f2 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -2540,8 +2540,7 @@ g_object_set_valist (GObject *object,
if (!g_object_set_is_valid_property (object, pspec, name))
break;
- G_VALUE_COLLECT_INIT (&value, pspec->value_type, var_args,
- 0, &error);
+ G_VALUE_COLLECT_INIT (&value, pspec->value_type, var_args, G_VALUE_NOCOPY_CONTENTS, &error);
if (error)
{
g_warning ("%s: %s", G_STRFUNC, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]