[PATCH wayland v4 08/11] client: Replace the singleton zombie with bespoke zombies

Daniel Stone daniel at fooishbar.org
Tue Jan 9 15:24:41 UTC 2018


Hi,

On 3 January 2018 at 22:25, Derek Foreman <derekf at osg.samsung.com> wrote:
> On 2017-12-28 01:53 PM, Daniel Stone wrote:
>> @@ -434,10 +499,14 @@ proxy_destroy(struct wl_proxy *proxy)
>>         if (proxy->flags & WL_PROXY_FLAG_ID_DELETED) {
>>                 wl_map_remove(&proxy->display->objects, proxy->object.id);
>>         } else if (proxy->object.id < WL_SERVER_ID_START) {
>> +               struct wl_zombie *zombie = prepare_zombie(proxy);
>
>
> I think we discussed this on irc and I said this patch was ok, but I missed
> this change...
>
> prepare_zombie(proxy) should probably only be called from wl_proxy_create
> and create_for_id - calling it in the destroy path results in a malloc()
> call during deleting.
>
> Should the malloc() fail and we can't actually allocate the zombie at during
> deletion we're going to have a problem.

Hm, yes. On the other hand, if we can't allocate the zombie object,
then we probably won't be able to allocate the closure when
demarshaling the events either?

The other thing I started doing before this move, was just allocating
zombie on the end of the wl_proxy so we only have one allocation and
free. It does mean that proxies will consume more memory when undead,
I suppose. I don't have strong feelings either way, so am happy to
with any of those three ...

> Otherwise, I like the way you've split up the series, and I've reviewed your
> new patches.

Thanks a lot! I'll leave them sit for a couple more days to see if
anyone spots anything and then just push them if not.

Cheers,
Daniel


More information about the wayland-devel mailing list