libsysprof-analyze: add is-free convenience property

This just allows filtering by the property rather than having to do an
expression like size==0.
This commit is contained in:
Christian Hergert
2023-04-28 11:46:12 -07:00
parent 86561c0c4f
commit 5efa3d04e7

View File

@ -36,6 +36,7 @@ struct _SysprofDocumentAllocationClass
enum {
PROP_0,
PROP_ADDRESS,
PROP_IS_FREE,
PROP_SIZE,
PROP_TID,
N_PROPS
@ -59,6 +60,10 @@ sysprof_document_allocation_get_property (GObject *object,
g_value_set_uint64 (value, sysprof_document_allocation_get_address (self));
break;
case PROP_IS_FREE:
g_value_set_boolean (value, sysprof_document_allocation_is_free (self));
break;
case PROP_SIZE:
g_value_set_int64 (value, sysprof_document_allocation_get_size (self));
break;
@ -115,6 +120,11 @@ sysprof_document_allocation_class_init (SysprofDocumentAllocationClass *klass)
G_MININT64, G_MAXINT64, 0,
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
properties [PROP_IS_FREE] =
g_param_spec_boolean ("is-free", NULL, NULL,
FALSE,
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_properties (object_class, N_PROPS, properties);
}