Don't inline deprecation warnings

The code that emits property deprecation warnings
rarely run, and doesn't need to be inlined in all
our property setters.
This commit is contained in:
Matthias Clasen 2021-09-29 01:38:43 -04:00
parent 4374cd9b6f
commit 27f0fdd18f

View File

@ -1490,16 +1490,13 @@ g_object_thaw_notify (GObject *object)
} }
static void static void
consider_issuing_property_deprecation_warning (const GParamSpec *pspec) maybe_issue_property_deprecation_warning (const GParamSpec *pspec)
{ {
static GHashTable *already_warned_table; static GHashTable *already_warned_table;
static const gchar *enable_diagnostic; static const gchar *enable_diagnostic;
static GMutex already_warned_lock; static GMutex already_warned_lock;
gboolean already; gboolean already;
if (!(pspec->flags & G_PARAM_DEPRECATED))
return;
if (g_once_init_enter (&enable_diagnostic)) if (g_once_init_enter (&enable_diagnostic))
{ {
const gchar *value = g_getenv ("G_ENABLE_DIAGNOSTIC"); const gchar *value = g_getenv ("G_ENABLE_DIAGNOSTIC");
@ -1539,6 +1536,13 @@ consider_issuing_property_deprecation_warning (const GParamSpec *pspec)
g_type_name (pspec->owner_type), pspec->name); 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 static inline void
object_get_property (GObject *object, object_get_property (GObject *object,
GParamSpec *pspec, GParamSpec *pspec,