[glib/gobject-speedup4: 24/25] Don't inline deprecation warnings
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/gobject-speedup4: 24/25] Don't inline deprecation warnings
- Date: Mon, 6 Jun 2022 15:30:14 +0000 (UTC)
commit d97c948567e85cb7b9c24b92544dafec8fdea906
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Sep 29 01:38:43 2021 -0400
Don't inline deprecation warnings
The code that emits property deprecation warnings
rarely runs, and doesn't need to be inlined
everywhere. It is enough to inline the check for
the deprecation flag.
gobject/gobject.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 3348426a84..d8448fb170 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -1492,16 +1492,13 @@ g_object_thaw_notify (GObject *object)
}
static void
-consider_issuing_property_deprecation_warning (const GParamSpec *pspec)
+maybe_issue_property_deprecation_warning (const GParamSpec *pspec)
{
static GHashTable *already_warned_table;
static const gchar *enable_diagnostic;
static GMutex already_warned_lock;
gboolean already;
- if (!(pspec->flags & G_PARAM_DEPRECATED))
- return;
-
if (g_once_init_enter (&enable_diagnostic))
{
const gchar *value = g_getenv ("G_ENABLE_DIAGNOSTIC");
@@ -1541,6 +1538,13 @@ consider_issuing_property_deprecation_warning (const GParamSpec *pspec)
g_type_name (pspec->owner_type), pspec->name);
}
+static inline void
+consider_issuing_property_deprecation_warning (const GParamSpec *pspec)
+{
+ if (G_UNLIKELY (pspec->flags & G_PARAM_DEPRECATED))
+ maybe_issue_property_deprecation_warning (pspec);
+}
+
static inline void
object_get_property (GObject *object,
GParamSpec *pspec,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]