pulsecore: Transform pa_mempool_new() into a factory method

Soon we're going to have three types of memory pools: POSIX shm_open()
pools, memfd memfd_create() ones, and privately malloc()-ed pools.

Thus introduce annotations for the memory types supported and change
pa_mempool_new() into a factory method based on required memory.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
This commit is contained in:
Ahmed S. Darwish 2016-03-13 00:57:06 +02:00 committed by David Henningsson
parent 211a520543
commit b88acd0266
18 changed files with 97 additions and 37 deletions

View file

@ -80,11 +80,11 @@ START_TEST (memblock_test) {
const char txt[] = "This is a test!";
pool_a = pa_mempool_new(true, 0);
pool_a = pa_mempool_new(PA_MEM_TYPE_SHARED_POSIX, 0);
fail_unless(pool_a != NULL);
pool_b = pa_mempool_new(true, 0);
pool_b = pa_mempool_new(PA_MEM_TYPE_SHARED_POSIX, 0);
fail_unless(pool_b != NULL);
pool_c = pa_mempool_new(true, 0);
pool_c = pa_mempool_new(PA_MEM_TYPE_SHARED_POSIX, 0);
fail_unless(pool_c != NULL);
pa_mempool_get_shm_id(pool_a, &id_a);