mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
client: Add WL_MAP_ENTRY_ZOMBIE flag
Add a new map entry flag to indicate that the object received is valid,
but a zombie. Previously this relied on a fixed object pointer, but
future patches in this series will have map entries returning either
NULL, or a different structure type entirely, for zombie objects.
wl_object_is_zombie() now solely uses the new flag to determine whether
or not the object is a zombie.
[daniels: Extracted from Derek's bespoke-zombie patch as an intermediate
step.]
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
69fab4fffc
commit
07d7a9968d
3 changed files with 21 additions and 9 deletions
|
|
@ -834,9 +834,18 @@ wl_connection_demarshal(struct wl_connection *connection,
|
|||
bool
|
||||
wl_object_is_zombie(struct wl_map *map, uint32_t id)
|
||||
{
|
||||
struct wl_object *object = wl_map_lookup(map, id);
|
||||
uint32_t flags;
|
||||
|
||||
return (object == WL_ZOMBIE_OBJECT);
|
||||
/* Zombie objects only exist on the client side. */
|
||||
if (map->side == WL_MAP_SERVER_SIDE)
|
||||
return false;
|
||||
|
||||
/* Zombie objects can only have been created by the client. */
|
||||
if (id >= WL_SERVER_ID_START)
|
||||
return false;
|
||||
|
||||
flags = wl_map_lookup_flags(map, id);
|
||||
return !!(flags & WL_MAP_ENTRY_ZOMBIE);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue