mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
mark: use gslice for inferred rect
We can get a little boost by using the gslice allocator for the structs of the same size.
This commit is contained in:
@ -79,7 +79,7 @@ free_inferred_rect (InferredRect *rect)
|
|||||||
{
|
{
|
||||||
g_free (rect->name);
|
g_free (rect->name);
|
||||||
g_free (rect->message);
|
g_free (rect->message);
|
||||||
g_free (rect);
|
g_slice_free (InferredRect, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -150,16 +150,12 @@ process_gpu_mark (BuildState *state,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rect = g_malloc0 (sizeof (*rect));
|
rect = g_slice_new0 (InferredRect);
|
||||||
if (!rect)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
rect->name = g_strdup (mark->name);
|
rect->name = g_strdup (mark->name);
|
||||||
rect->message = g_strdup (mark->message);
|
rect->message = g_strdup (mark->message);
|
||||||
rect->time = mark->frame.time;
|
rect->time = mark->frame.time;
|
||||||
g_hash_table_insert (state->inferred_rects,
|
|
||||||
rect->message,
|
g_hash_table_insert (state->inferred_rects, rect->message, rect);
|
||||||
rect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
Reference in New Issue
Block a user