diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2018-06-04 11:38:40 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2018-06-11 14:59:39 +0100 |
commit | 827c208cbf9cc0ef17b8c4531a40aafe1edc3f01 (patch) | |
tree | 7409c32ff349bf80c71822ee8c124ea90ba931f1 /glib/grefcount.c | |
parent | 9e5a53d576765819d1c7c233515b9f6e5d77eb61 (diff) | |
download | glib-827c208cbf9cc0ef17b8c4531a40aafe1edc3f01.tar.gz |
Use macros for refcount types API
If we're using GCC we can use __extension__ to inline the grefcount and
gatomicrefcount API, and avoid the function call.
These macros are only enabled if G_DISABLE_CHECKS is defined, as they
remove critical warnings when the reference counters achieve saturation.
Diffstat (limited to 'glib/grefcount.c')
-rw-r--r-- | glib/grefcount.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/glib/grefcount.c b/glib/grefcount.c index 10e35a217..37085316b 100644 --- a/glib/grefcount.c +++ b/glib/grefcount.c @@ -89,7 +89,7 @@ * Since: 2.58 */ void -g_ref_count_init (grefcount *rc) +(g_ref_count_init) (grefcount *rc) { g_return_if_fail (rc != NULL); @@ -114,7 +114,7 @@ g_ref_count_init (grefcount *rc) * Since: 2.58 */ void -g_ref_count_inc (grefcount *rc) +(g_ref_count_inc) (grefcount *rc) { grefcount rrc; @@ -147,7 +147,7 @@ g_ref_count_inc (grefcount *rc) * Since: 2.58 */ gboolean -g_ref_count_dec (grefcount *rc) +(g_ref_count_dec) (grefcount *rc) { grefcount rrc; @@ -179,8 +179,8 @@ g_ref_count_dec (grefcount *rc) * Since: 2.58 */ gboolean -g_ref_count_compare (grefcount *rc, - gint val) +(g_ref_count_compare) (grefcount *rc, + gint val) { grefcount rrc; @@ -204,7 +204,7 @@ g_ref_count_compare (grefcount *rc, * Since: 2.58 */ void -g_atomic_ref_count_init (gatomicrefcount *arc) +(g_atomic_ref_count_init) (gatomicrefcount *arc) { g_return_if_fail (arc != NULL); @@ -229,7 +229,7 @@ g_atomic_ref_count_init (gatomicrefcount *arc) * Since: 2.58 */ void -g_atomic_ref_count_inc (gatomicrefcount *arc) +(g_atomic_ref_count_inc) (gatomicrefcount *arc) { g_return_if_fail (arc != NULL); g_return_if_fail (g_atomic_int_get (arc) > 0); @@ -254,7 +254,7 @@ g_atomic_ref_count_inc (gatomicrefcount *arc) * Since: 2.58 */ gboolean -g_atomic_ref_count_dec (gatomicrefcount *arc) +(g_atomic_ref_count_dec) (gatomicrefcount *arc) { g_return_val_if_fail (arc != NULL, FALSE); g_return_val_if_fail (g_atomic_int_get (arc) > 0, FALSE); @@ -275,8 +275,8 @@ g_atomic_ref_count_dec (gatomicrefcount *arc) * Since: 2.58 */ gboolean -g_atomic_ref_count_compare (gatomicrefcount *arc, - gint val) +(g_atomic_ref_count_compare) (gatomicrefcount *arc, + gint val) { g_return_val_if_fail (arc != NULL, FALSE); g_return_val_if_fail (val >= 0, FALSE); |