leakstracer: Get rid of GSlice usage

It's not faster than malloc, and is slower in most cases. Glib is also
getting rid of it entirely: https://gitlab.gnome.org/GNOME/glib/merge_requests/940
This commit is contained in:
Nirbheek Chauhan 2019-06-24 21:14:51 +05:30 committed by Nirbheek Chauhan
parent a1c44cca3a
commit 3e2f24955e

View file

@ -271,7 +271,7 @@ typedef struct
static ObjectLog *
object_log_new (gpointer obj)
{
ObjectLog *o = g_slice_new (ObjectLog);
ObjectLog *o = g_new (ObjectLog, 1);
o->object = obj;
@ -286,7 +286,7 @@ object_log_new (gpointer obj)
static void
object_log_free (ObjectLog * obj)
{
g_slice_free (ObjectLog, obj);
g_free (obj);
}
#endif /* G_OS_UNIX */
@ -496,7 +496,7 @@ typedef struct
static Leak *
leak_new (gpointer obj, GType type, guint ref_count, ObjectRefingInfos * infos)
{
Leak *leak = g_slice_new (Leak);
Leak *leak = g_new (Leak, 1);
leak->obj = obj;
leak->type_name = g_type_name (type);
@ -511,7 +511,7 @@ static void
leak_free (Leak * leak)
{
g_free (leak->desc);
g_slice_free (Leak, leak);
g_free (leak);
}
static gint