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
This commit is contained in:
Wim Taymans 2021-07-19 12:13:25 +02:00
parent 1531f78965
commit 587e9d5fb1

View file

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