]> git.ozlabs.org Git - ccan/blobdiff - ccan/talloc/talloc.h
talloc: spelling fix.
[ccan] / ccan / talloc / talloc.h
index d27c68922c9c8f0d98a0b5fe76d3ea4b8093d3fb..5263b9fed269261f833b2e9d55765a7242ca964b 100644 (file)
@@ -957,6 +957,19 @@ size_t talloc_get_size(const void *ctx);
  */
 void *talloc_find_parent_byname(const void *ctx, const char *name);
 
+/**
+ * talloc_set_allocator - set the allocations function(s) for talloc.
+ * @malloc: the malloc function
+ * @free: the free function
+ * @realloc: the realloc function
+ *
+ * Instead of using the standard malloc, free and realloc, talloc will use
+ * these replacements.  @realloc will never be called with size 0 or ptr NULL.
+ */
+void talloc_set_allocator(void *(*malloc)(size_t size),
+                         void (*free)(void *ptr),
+                         void *(*realloc)(void *ptr, size_t size));
+
 /**
  * talloc_add_external - create an externally allocated node
  * @ctx: the parent