util/ralloc: add memdup

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27762>
This commit is contained in:
Alyssa Rosenzweig
2024-02-22 10:13:51 -04:00
committed by Marge Bot
parent d964f57a48
commit 66b00e2966
2 changed files with 17 additions and 0 deletions
+5
View File
@@ -313,6 +313,11 @@ void *ralloc_parent(const void *ptr);
*/
void ralloc_set_destructor(const void *ptr, void(*destructor)(void *));
/**
* Duplicate memory, allocating the memory from the given context.
*/
void *ralloc_memdup(const void *ctx, const void *mem, size_t n) MALLOCLIKE;
/// \defgroup array String Functions @{
/**
* Duplicate a string, allocating the memory from the given context.