mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
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:
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user