remove global memblock statistic variables in favor of memblock_stat objects

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@137 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2004-08-17 19:37:29 +00:00
parent 81822a7519
commit e75b65715b
32 changed files with 158 additions and 80 deletions

View file

@ -210,7 +210,7 @@ static int pa_cli_command_source_outputs(struct pa_core *c, struct pa_tokenizer
static int pa_cli_command_stat(struct pa_core *c, struct pa_tokenizer *t, struct pa_strbuf *buf, int *fail, int *verbose) {
assert(c && t);
pa_strbuf_printf(buf, "Memory blocks allocated: %u, total size: %u bytes.\n", pa_memblock_get_count(), pa_memblock_get_total());
pa_strbuf_printf(buf, "Memory blocks currently allocated: %u, size: %u bytes.\nMemory blocks allocated during the whole lifetime: %u, size: %u bytes.\n", c->memblock_stat->total, c->memblock_stat->total_size, c->memblock_stat->allocated, c->memblock_stat->allocated_size);
return 0;
}
@ -504,7 +504,7 @@ static int pa_cli_command_scache_load(struct pa_core *c, struct pa_tokenizer *t,
return -1;
}
if (pa_sound_file_load(fname, &ss, &chunk) < 0) {
if (pa_sound_file_load(fname, &ss, &chunk, c->memblock_stat) < 0) {
pa_strbuf_puts(buf, "Failed to load sound file.\n");
return -1;
}
@ -532,7 +532,7 @@ static int pa_cli_command_play_file(struct pa_core *c, struct pa_tokenizer *t, s
return -1;
}
if (pa_sound_file_load(fname, &ss, &chunk) < 0) {
if (pa_sound_file_load(fname, &ss, &chunk, c->memblock_stat) < 0) {
pa_strbuf_puts(buf, "Failed to load sound file.\n");
return -1;
}