mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-01 07:15:32 -04:00
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.
This commit is contained in:
parent
129deaffa8
commit
abbdd3bae8
2 changed files with 9 additions and 0 deletions
7
shm.c
7
shm.c
|
|
@ -509,6 +509,13 @@ err:
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
shm_did_not_use_buf(struct buffer *_buf)
|
||||||
|
{
|
||||||
|
struct buffer_private *buf = (struct buffer_private *)_buf;
|
||||||
|
buf->busy = false;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
shm_get_many(struct buffer_chain *chain, size_t count,
|
shm_get_many(struct buffer_chain *chain, size_t count,
|
||||||
int widths[static count], int heights[static count],
|
int widths[static count], int heights[static count],
|
||||||
|
|
|
||||||
2
shm.h
2
shm.h
|
|
@ -66,6 +66,8 @@ void shm_get_many(
|
||||||
int widths[static count], int heights[static count],
|
int widths[static count], int heights[static count],
|
||||||
struct buffer *bufs[static count]);
|
struct buffer *bufs[static count]);
|
||||||
|
|
||||||
|
void shm_did_not_use_buf(struct buffer *buf);
|
||||||
|
|
||||||
bool shm_can_scroll(const struct buffer *buf);
|
bool shm_can_scroll(const struct buffer *buf);
|
||||||
bool shm_scroll(struct buffer *buf, int rows,
|
bool shm_scroll(struct buffer *buf, int rows,
|
||||||
int top_margin, int top_keep_rows,
|
int top_margin, int top_keep_rows,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue