From 587e9d5fb1ea8ee36af199f22ecb8f8ad10d4277 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 19 Jul 2021 12:13:25 +0200 Subject: [PATCH] mem: remove unused global mempools list The mempools list keeps track of all allocated mempools but is otherwise not used. Because it is not protected with a lock, concurrent contexts or thread loops can step on eachother and crash. Remove this for now until we actually need it and implement it with some sort of lock. Fixes #1416 --- src/pipewire/mem.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/pipewire/mem.c b/src/pipewire/mem.c index d76c8335b..53806b5b9 100644 --- a/src/pipewire/mem.c +++ b/src/pipewire/mem.c @@ -90,8 +90,6 @@ static inline int memfd_create(const char *name, unsigned int flags) #define F_SEAL_WRITE 0x0008 /* prevent writes */ #endif -static struct spa_list _mempools = SPA_LIST_INIT(&_mempools); - #define pw_mempool_emit(p,m,v,...) spa_hook_list_call(&p->listener_list, struct pw_mempool_events, m, v, ##__VA_ARGS__) #define pw_mempool_emit_destroy(p) pw_mempool_emit(p, destroy, 0) #define pw_mempool_emit_added(p,b) pw_mempool_emit(p, added, 0, b) @@ -100,8 +98,6 @@ static struct spa_list _mempools = SPA_LIST_INIT(&_mempools); struct mempool { struct pw_mempool this; - struct spa_list link; /* link in global _mempools */ - struct spa_hook_list listener_list; struct pw_map map; /* map memblock to id */ @@ -154,8 +150,6 @@ struct pw_mempool *pw_mempool_new(struct pw_properties *props) pw_map_init(&impl->map, 64, 64); spa_list_init(&impl->blocks); - spa_list_append(&_mempools, &impl->link); - return this; } @@ -181,8 +175,6 @@ void pw_mempool_destroy(struct pw_mempool *pool) pw_mempool_clear(pool); - spa_list_remove(&impl->link); - spa_hook_list_clean(&impl->listener_list); pw_map_clear(&impl->map);