mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 15:40:53 +00:00
Add forgotten put_cpu_var(). Parse in chunks of 65536 to improve locality.
2006-12-09 Soren Sandmann <sandmann@daimi.au.dk> * module/sysprof-module.c: Add forgotten put_cpu_var(). * sfile.c (build_instructions): Parse in chunks of 65536 to improve locality.
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
4ba672ee9f
commit
bd1f064ad3
18
sfile.c
18
sfile.c
@ -628,11 +628,25 @@ build_instructions (const char *contents,
|
||||
build.instructions = g_array_new (TRUE, TRUE, sizeof (Instruction));
|
||||
|
||||
parse_context = g_markup_parse_context_new (&parser, 0, &build, NULL);
|
||||
|
||||
while (length)
|
||||
{
|
||||
int bytes = MIN (length, 65536);
|
||||
|
||||
if (!g_markup_parse_context_parse (parse_context, contents, bytes, err))
|
||||
{
|
||||
free_instructions ((Instruction *)build.instructions->data, build.instructions->len);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
contents += bytes;
|
||||
length -= bytes;
|
||||
}
|
||||
|
||||
if (!g_markup_parse_context_parse (parse_context, contents, length, err))
|
||||
if (!g_markup_parse_context_end_parse (parse_context, err))
|
||||
{
|
||||
free_instructions ((Instruction *)build.instructions->data, build.instructions->len);
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!scontext_is_finished (build.context))
|
||||
|
||||
Reference in New Issue
Block a user