util: unified and enhanced zombie handing in wl_map

servers and clients now both use zombies.  Zombies are
interface pointers, so that they retain info for
demarshalling fds AND new_id args, which must be turned
into other zombies.

Demarshalling messages to zombies is handled by the
same wl_connection_demarshal code used for messages
to live objects.

Server zombies are eventually reaped after moving
through FIFO zombie ring, because there is no delete_id
request in the protocol.

Signed-off-by: Jonathan Leivent <jleivent@comcast.net>
This commit is contained in:
Jonathan Leivent 2024-01-26 18:42:14 -05:00
parent 0db836ebc8
commit dcd5996175
7 changed files with 436 additions and 180 deletions

View file

@ -393,6 +393,7 @@ demarshal(struct marshal_data *data, const char *format,
assert(closure);
wl_closure_invoke(closure, WL_CLOSURE_INVOKE_SERVER, &object, 0, data);
wl_closure_destroy(closure);
wl_map_release(&objects);
}
TEST(connection_demarshal)
@ -476,6 +477,7 @@ marshal_demarshal(struct marshal_data *data,
assert(closure);
wl_closure_invoke(closure, WL_CLOSURE_INVOKE_SERVER, &object, 0, data);
wl_closure_destroy(closure);
wl_map_release(&objects);
}
TEST(connection_marshal_demarshal)
@ -540,6 +542,7 @@ expected_fail_demarshal(struct marshal_data *data, const char *format,
assert(closure == NULL);
assert(errno == expected_error);
wl_map_release(&objects);
}
TEST(connection_demarshal_null_strings)