diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2020-11-24 14:45:11 +0000 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2020-11-24 14:45:11 +0000 |
commit | 69f0f3326755891c48783c3831c71c5ea3d659a1 (patch) | |
tree | 512aaf91c48bef713db135a84c5b606218f20d72 | |
parent | 23ad18791dc2138bc6f5b98465c9e8e898cbdbbe (diff) | |
parent | fb6e10c959038d8a83dc9f52eb58763d00ece3e5 (diff) | |
download | glib-69f0f3326755891c48783c3831c71c5ea3d659a1.tar.gz |
Merge branch 'mcatanzaro/#2076' into 'master'
Suppress some valgrind leak warnings
Closes #2076
See merge request GNOME/glib!1768
-rw-r--r-- | gobject/gatomicarray.c | 6 | ||||
-rw-r--r-- | gobject/gtype.c | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gobject/gatomicarray.c b/gobject/gatomicarray.c index 5ebf6b89b..43111e8c7 100644 --- a/gobject/gatomicarray.c +++ b/gobject/gatomicarray.c @@ -17,6 +17,7 @@ #include "config.h" +#include "../glib/gvalgrind.h" #include <string.h> #include "gatomicarray.h" @@ -77,6 +78,11 @@ freelist_alloc (gsize size, gboolean reuse) mem = g_slice_alloc (real_size); mem = ((char *) mem) + sizeof (gsize); G_ATOMIC_ARRAY_DATA_SIZE (mem) = size; + +#if ENABLE_VALGRIND + VALGRIND_MALLOCLIKE_BLOCK (mem, real_size - sizeof (gsize), FALSE, FALSE); +#endif + return mem; } diff --git a/gobject/gtype.c b/gobject/gtype.c index 909faf138..69cd27512 100644 --- a/gobject/gtype.c +++ b/gobject/gtype.c @@ -442,6 +442,10 @@ type_node_any_new_W (TypeNode *pnode, node = G_STRUCT_MEMBER_P (node, SIZEOF_FUNDAMENTAL_INFO); static_fundamental_type_nodes[ftype >> G_TYPE_FUNDAMENTAL_SHIFT] = node; type = ftype; + +#if ENABLE_VALGRIND + VALGRIND_MALLOCLIKE_BLOCK (node, node_size - SIZEOF_FUNDAMENTAL_INFO, FALSE, TRUE); +#endif } else type = (GType) node; |