Skip to content

gthread: Add g_private_set_alloc0() convenience API

Philip Withnall requested to merge pwithnall/glib:private-set-alloc0 into master

This is a wrapper around g_private_set() which allocates the desired amount of memory for the caller and calls g_private_set() on it.

This is intended to make it easier to suppress Valgrind warnings about leaked memory, since g_private_set() is typically used to make one-time per-thread allocations. We can now just add a blanket suppression rule for any allocations inside g_private_set_alloc0().

Signed-off-by: Philip Withnall withnall@endlessm.com

Edited by Philip Withnall

Merge request reports