[glib/gobject-speedups: 6/13] Don't copy values when collecting in g_object_new




commit 94aa288e0656e577bb545f2d243c054b6a6b90ec
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 14 23:27:54 2022 -0400

    Don't copy values when collecting in g_object_new
    
    We can safely use the values without copying here.

 gobject/gobject.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index b9f4561a8e..54386f5692 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -2365,7 +2365,7 @@ g_object_new_valist (GType        object_type,
           params[n_params].value = &values[n_params];
           memset (&values[n_params], 0, sizeof (GValue));
 
-          G_VALUE_COLLECT_INIT (&values[n_params], pspec->value_type, var_args, 0, &error);
+          G_VALUE_COLLECT_INIT (&values[n_params], pspec->value_type, var_args, G_VALUE_NOCOPY_CONTENTS, 
&error);
 
           if (error)
             {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]