From 168b710feef318d238f8ef5e090f08a680b5ca23 Mon Sep 17 00:00:00 2001 From: Martin Nagy Date: Fri, 13 Mar 2009 20:13:21 +0100 Subject: Add SAFE_MEM_PUT_AND_DETACH() macro. The macro takes one argument, which is a pointer to a struct that contains isc_mem_t pointer member called 'mctx'. The macro will free up the argument and detach it from the memory context. --- util.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util.h') diff --git a/util.h b/util.h index 5b40a33..6c46516 100644 --- a/util.h +++ b/util.h @@ -58,4 +58,8 @@ #define SAFE_MEM_PUT_PTR(m, target_ptr) \ SAFE_MEM_PUT((m), (target_ptr), sizeof(*(target_ptr))) +#define MEM_PUT_AND_DETACH(target_ptr) \ + isc_mem_putanddetach(&(target_ptr)->mctx, target_ptr, \ + sizeof(*(target_ptr))) + #endif /* !_LD_UTIL_H_ */ -- cgit