mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
util/mem: Move memdup to new util/mem.c file
This seems handy and I want to use this in wlr_color_representation.
This commit is contained in:
parent
c14aa1d0b8
commit
f5dc6416f0
4 changed files with 33 additions and 11 deletions
14
include/util/mem.h
Normal file
14
include/util/mem.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#ifndef UTIL_MEM_H
|
||||
#define UTIL_MEM_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/**
|
||||
* Allocate a new block of memory and copy *src to it, then store the address
|
||||
* of the new allocation in *out. Returns true if it worked, or false if
|
||||
* allocation failed.
|
||||
*/
|
||||
bool memdup(void *out, const void *src, size_t size);
|
||||
|
||||
#endif // UTIL_MEM_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue