mirror of
https://github.com/labwc/labwc.git
synced 2025-11-06 13:29:58 -05:00
common: Add znew/znew_n() macros
This commit is contained in:
parent
da57483961
commit
a54d378e6c
26 changed files with 47 additions and 47 deletions
|
|
@ -68,7 +68,7 @@ _update_buffer(struct scaled_scene_buffer *self, double scale)
|
|||
|
||||
/* Create or reuse cache entry */
|
||||
if (wl_list_length(&self->cache) < LAB_SCALED_BUFFER_MAX_CACHE) {
|
||||
cache_entry = xzalloc(sizeof(*cache_entry));
|
||||
cache_entry = znew(*cache_entry);
|
||||
} else {
|
||||
cache_entry = wl_container_of(self->cache.prev, cache_entry, link);
|
||||
if (cache_entry->buffer) {
|
||||
|
|
@ -151,8 +151,7 @@ scaled_scene_buffer_create(struct wlr_scene_tree *parent,
|
|||
assert(impl);
|
||||
assert(impl->create_buffer);
|
||||
|
||||
struct scaled_scene_buffer *self = xzalloc(sizeof(*self));
|
||||
|
||||
struct scaled_scene_buffer *self = znew(*self);
|
||||
self->scene_buffer = wlr_scene_buffer_create(parent, NULL);
|
||||
if (!self->scene_buffer) {
|
||||
wlr_log(WLR_ERROR, "Failed to create scene buffer");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue