+
+void talloc_external_enable(void *(*alloc)(void *parent, size_t size),
+ void (*free)(void *ptr, void *parent),
+ void *(*realloc)(void *ptr, void *parent, size_t))
+{
+ tc_external_alloc = alloc;
+ tc_external_free = free;
+ tc_external_realloc = realloc;
+}
+
+void talloc_mark_external(void *context)
+{
+ struct talloc_chunk *tc;
+
+ if (unlikely(context == NULL)) {
+ context = null_context;
+ }
+
+ tc = talloc_chunk_from_ptr(context);
+ tc->flags |= TALLOC_FLAG_EXT_ALLOC;
+}