diff options
Diffstat (limited to 'mesalib/src/util/ralloc.h')
-rw-r--r-- | mesalib/src/util/ralloc.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/mesalib/src/util/ralloc.h b/mesalib/src/util/ralloc.h index f088a3627..7587e1190 100644 --- a/mesalib/src/util/ralloc.h +++ b/mesalib/src/util/ralloc.h @@ -46,16 +46,16 @@ #ifndef RALLOC_H #define RALLOC_H -#ifdef __cplusplus -extern "C" { -#endif - #include <stddef.h> #include <stdarg.h> #include <stdbool.h> #include "macros.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * \def ralloc(ctx, type) * Allocate a new object chained off of the given context. @@ -235,6 +235,13 @@ void ralloc_free(void *ptr); void ralloc_steal(const void *new_ctx, void *ptr); /** + * Reparent all children from one context to another. + * + * This effectively calls ralloc_steal(new_ctx, child) for all children of \p old_ctx. + */ +void ralloc_adopt(const void *new_ctx, void *old_ctx); + +/** * Return the given pointer's ralloc context. */ void *ralloc_parent(const void *ptr); |