Regarding shm_pool and buffer.

Pekka Paalanen ppaalanen at
Fri Feb 5 10:01:56 UTC 2016

On Fri, 5 Feb 2016 08:23:53 +0900
nicesj at wrote:

> Dear all,
> I can learn many things from this mailing list, thank you very much.
> I have one more doubt about relations between memory pool and buffer.
> I read a doc of wayland and it explains a wl_buffer can be created from shm-pool.
> but in the example code, after creates the buffer from pool, attach
> it to the surface, and then the example destroyes shm pool resources
> from the client side.
> so the server will gets destroy request.
> the buffer which is attached to surface, however, still in use.
> If I understood correctly, the pool should not be destroyed until all
> wl-buffers are freed.
> Am I understood correctly?
> or does the server should keep the pool information even though the
> client destroyes it?


all wl_shm-based wl_buffer objects keep a reference to the underlying
memory in compositors. Only after both the wl_shm_pool and all
wl_buffers created from it are destroyed, will the compositor free the
underlying memory.

See the documentation of wl_shm_pool::create_buffer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the wayland-devel mailing list