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:
Soren Sandmann
2006-12-09 06:29:43 +00:00
committed by Søren Sandmann Pedersen
parent 4ba672ee9f
commit bd1f064ad3
4 changed files with 29 additions and 4 deletions

18
sfile.c
View File

@ -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))