map: mark removed object as removed

Normally the invalid bit is set on the removed object by copying it
from the free list. If there is no free list, also set the bit.
This commit is contained in:
Wim Taymans 2018-08-14 16:47:50 +02:00
parent a37694fde5
commit 954da89756

View file

@ -139,7 +139,7 @@ static inline bool pw_map_insert_at(struct pw_map *map, uint32_t id, void *data)
*/
static inline void pw_map_remove(struct pw_map *map, uint32_t id)
{
pw_map_get_item(map, id)->next = map->free_list;
pw_map_get_item(map, id)->next = map->free_list | 1;
map->free_list = (id << 1) | 1;
}