[glib/finalize-speedups] Artificially limit g_datalist_id_remove_multiple



commit 96e4e57c552838cf62141bd5aa344cb734bad89d
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun May 22 21:47:23 2022 -0400

    Artificially limit g_datalist_id_remove_multiple
    
    Allow up to 16 keys to be removed in one go.
    
    Its enough for the use we have in GObject.

 glib/gdataset.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/glib/gdataset.c b/glib/gdataset.c
index 2038d5b659..05c8d3a8b1 100644
--- a/glib/gdataset.c
+++ b/glib/gdataset.c
@@ -756,7 +756,7 @@ g_datalist_id_set_data_full (GData    **datalist,
  * g_datalist_id_remove_multiple:
  * @datalist: a datalist
  * @keys: keys to remove
- * @n_keys: length of @keys
+ * @n_keys: length of @keys, must be <= 16
  *
  * Removes multiple keys from a datalist.
  *
@@ -770,6 +770,8 @@ g_datalist_id_remove_multiple (GData  **datalist,
                                GQuark  *keys,
                                guint    n_keys)
 {
+  g_return_if_fail (n_keys <= 16);
+
   g_data_remove_internal (datalist, keys, n_keys);
 }
 


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