gmain: Add debug metrics for gnome-shell

This commit is contained in:
Ray Strode
2021-05-26 23:47:11 -04:00
parent 1de7a602f5
commit dbd50f23db
8 changed files with 641 additions and 34 deletions

View File

@@ -74,7 +74,7 @@ freelist_alloc (gsize size, gboolean reuse)
}
real_size = sizeof (gsize) + MAX (size, sizeof (FreeListNode));
mem = g_slice_alloc (real_size);
mem = g_slice_alloc_with_name (real_size, "FreeListNode");
mem = ((char *) mem) + sizeof (gsize);
G_ATOMIC_ARRAY_DATA_SIZE (mem) = size;
return mem;

View File

@@ -1846,7 +1846,7 @@ g_type_create_instance (GType type)
VALGRIND_MALLOCLIKE_BLOCK (allocated + ALIGN_STRUCT (1), private_size - ALIGN_STRUCT (1), 0, TRUE);
}
else
allocated = g_slice_alloc0 (private_size + ivar_size);
allocated = g_slice_alloc0_with_name (private_size + ivar_size, type_descriptive_name_I (type));
instance = (GTypeInstance *) (allocated + private_size);
@@ -1941,7 +1941,7 @@ g_type_free_instance (GTypeInstance *instance)
VALGRIND_FREELIKE_BLOCK (instance, 0);
}
else
g_slice_free1 (private_size + ivar_size, allocated);
g_slice_free1_with_name (private_size + ivar_size, allocated, type_descriptive_name_I (class->g_type));
#ifdef G_ENABLE_DEBUG
IF_DEBUG (INSTANCE_COUNT)