don't maintain a list of allocated mempool slots, we don't use it anyway

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1380 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2006-09-07 20:17:25 +00:00
parent 1728e3ac98
commit 791bbd8e0e

View file

@ -101,7 +101,6 @@ struct pa_mempool {
/* A list of free slots that may be reused */ /* A list of free slots that may be reused */
PA_LLIST_HEAD(struct mempool_slot, free_slots); PA_LLIST_HEAD(struct mempool_slot, free_slots);
PA_LLIST_HEAD(struct mempool_slot, used_slots);
pa_mempool_stat stat; pa_mempool_stat stat;
}; };
@ -195,7 +194,6 @@ static struct mempool_slot* mempool_allocate_slot(pa_mempool *p) {
return NULL; return NULL;
} }
PA_LLIST_PREPEND(struct mempool_slot, p->used_slots, slot);
return slot; return slot;
} }
@ -354,7 +352,6 @@ void pa_memblock_unref(pa_memblock*b) {
slot = mempool_slot_by_ptr(b->pool, b->data); slot = mempool_slot_by_ptr(b->pool, b->data);
assert(slot); assert(slot);
PA_LLIST_REMOVE(struct mempool_slot, b->pool->used_slots, slot);
PA_LLIST_PREPEND(struct mempool_slot, b->pool->free_slots, slot); PA_LLIST_PREPEND(struct mempool_slot, b->pool->free_slots, slot);
if (b->type == PA_MEMBLOCK_POOL_EXTERNAL) if (b->type == PA_MEMBLOCK_POOL_EXTERNAL)
@ -471,7 +468,6 @@ pa_mempool* pa_mempool_new(int shared) {
PA_LLIST_HEAD_INIT(pa_memimport, p->imports); PA_LLIST_HEAD_INIT(pa_memimport, p->imports);
PA_LLIST_HEAD_INIT(pa_memexport, p->exports); PA_LLIST_HEAD_INIT(pa_memexport, p->exports);
PA_LLIST_HEAD_INIT(struct mempool_slot, p->free_slots); PA_LLIST_HEAD_INIT(struct mempool_slot, p->free_slots);
PA_LLIST_HEAD_INIT(struct mempool_slot, p->used_slots);
memset(&p->stat, 0, sizeof(p->stat)); memset(&p->stat, 0, sizeof(p->stat));
@ -505,10 +501,9 @@ void pa_mempool_vacuum(pa_mempool *p) {
assert(p); assert(p);
for (slot = p->free_slots; slot; slot = slot->next) { for (slot = p->free_slots; slot; slot = slot->next)
pa_shm_punch(&p->memory, (uint8_t*) slot + sizeof(struct mempool_slot) - (uint8_t*) p->memory.ptr, p->block_size - sizeof(struct mempool_slot)); pa_shm_punch(&p->memory, (uint8_t*) slot + sizeof(struct mempool_slot) - (uint8_t*) p->memory.ptr, p->block_size - sizeof(struct mempool_slot));
} }
}
int pa_mempool_get_shm_id(pa_mempool *p, uint32_t *id) { int pa_mempool_get_shm_id(pa_mempool *p, uint32_t *id) {
assert(p); assert(p);