mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
common: Add additional memory utilities (xzalloc() etc.)
This commit is contained in:
parent
b89f7bfc0d
commit
cb40cdc36c
35 changed files with 193 additions and 167 deletions
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include "common/mem.h"
|
||||
#include "node.h"
|
||||
|
||||
static void
|
||||
|
|
@ -26,10 +27,7 @@ node_descriptor_create(struct wlr_scene_node *scene_node,
|
|||
enum node_descriptor_type type, void *data)
|
||||
{
|
||||
struct node_descriptor *node_descriptor =
|
||||
calloc(1, sizeof(struct node_descriptor));
|
||||
if (!node_descriptor) {
|
||||
return;
|
||||
}
|
||||
xzalloc(sizeof(struct node_descriptor));
|
||||
node_descriptor->type = type;
|
||||
node_descriptor->data = data;
|
||||
node_descriptor->destroy.notify = destroy_notify;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue