summaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
authorMartin Nagy <mnagy@redhat.com>2009-03-13 20:13:21 +0100
committerMartin Nagy <mnagy@redhat.com>2009-03-14 01:02:32 +0100
commit168b710feef318d238f8ef5e090f08a680b5ca23 (patch)
tree081a011175aa03d7bfc02f5993864f46c56e27c8 /util.h
parenta6192e2cb27b26028363b56da8f04e8de429e704 (diff)
downloadldap_driver_testing-168b710feef318d238f8ef5e090f08a680b5ca23.tar.gz
ldap_driver_testing-168b710feef318d238f8ef5e090f08a680b5ca23.tar.xz
ldap_driver_testing-168b710feef318d238f8ef5e090f08a680b5ca23.zip
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.
Diffstat (limited to 'util.h')
-rw-r--r--util.h4
1 files changed, 4 insertions, 0 deletions
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_ */