diff options
| author | Michael Biebl <biebl@debian.org> | 2021-02-18 18:54:58 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2021-02-18 18:54:58 +0100 |
| commit | eca19fa2272137cfd38135376f8cbf6d0a2f2187 (patch) | |
| tree | 36d3cdb47cd2b3b367dced642667479007ffaf62 /shared/nm-glib-aux | |
| parent | 16df93361dd8829fa730e08ce96650b499a59f70 (diff) | |
| parent | 3a56bce6c0ea7ba0fe269520547740783b342e0d (diff) | |
Update upstream source from tag 'upstream/1.30.0'
Update to upstream version '1.30.0' with Debian dir e4e3c5986af4d47930d9e35ac7d8bc6c70bd1dd9
Diffstat (limited to 'shared/nm-glib-aux')
| -rw-r--r-- | shared/nm-glib-aux/nm-ref-string.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/shared/nm-glib-aux/nm-ref-string.c b/shared/nm-glib-aux/nm-ref-string.c index 902f1c80..1084c47f 100644 --- a/shared/nm-glib-aux/nm-ref-string.c +++ b/shared/nm-glib-aux/nm-ref-string.c @@ -49,20 +49,28 @@ _ref_string_equal(gconstpointer pa, gconstpointer pb) static void _ASSERT(const RefString *rstr0) { -#if NM_MORE_ASSERTS int r; nm_assert(rstr0); - G_LOCK(gl_lock); - r = g_atomic_int_get(&rstr0->ref_count); + if (NM_MORE_ASSERTS > 0) { + r = g_atomic_int_get(&rstr0->ref_count); + nm_assert(r > 0); + nm_assert(r < G_MAXINT); + } - nm_assert(r > 0); - nm_assert(r < G_MAXINT); + nm_assert(rstr0->r.str == rstr0->str_data); + nm_assert(rstr0->r.str[rstr0->r.len] == '\0'); - nm_assert(rstr0 == g_hash_table_lookup(gl_hash, rstr0)); - G_UNLOCK(gl_lock); -#endif + if (NM_MORE_ASSERTS > 10) { + G_LOCK(gl_lock); + r = g_atomic_int_get(&rstr0->ref_count); + nm_assert(r > 0); + nm_assert(r < G_MAXINT); + + nm_assert(rstr0 == g_hash_table_lookup(gl_hash, rstr0)); + G_UNLOCK(gl_lock); + } } /** |