util: document xmemdup()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
c19965cfff
commit
7d34f45ed6
|
@ -148,6 +148,11 @@ xrealloc(void **ptr, ssize_t newsize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Duplicate a memory zone.
|
||||||
|
* \param src The source.
|
||||||
|
* \param size The source size.
|
||||||
|
* \return The memory address of the copy.
|
||||||
|
*/
|
||||||
static inline void *xmemdup(const void *src, ssize_t size)
|
static inline void *xmemdup(const void *src, ssize_t size)
|
||||||
{
|
{
|
||||||
return memcpy(xmalloc(size), src, size);
|
return memcpy(xmalloc(size), src, size);
|
||||||
|
|
Loading…
Reference in New Issue