From abbdd3bae884a4bcea20d5059f25684f9a5a7571 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 16 Apr 2022 17:47:56 +0200 Subject: shm: add shm_did_not_use_buffer() This allows a caller to return a buffer (obtained with shm_get_buffer()) to the pool, The buffer must not have been used. I.e. it must not have been attached and committed to a wayland surface. --- shm.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'shm.c') diff --git a/shm.c b/shm.c index 005d030e..4c342ddf 100644 --- a/shm.c +++ b/shm.c @@ -509,6 +509,13 @@ err: abort(); } +void +shm_did_not_use_buf(struct buffer *_buf) +{ + struct buffer_private *buf = (struct buffer_private *)_buf; + buf->busy = false; +} + void shm_get_many(struct buffer_chain *chain, size_t count, int widths[static count], int heights[static count], -- cgit v1.3