summaryrefslogtreecommitdiff
path: root/src/common/memarea.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-17 12:27:25 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-08 14:47:19 -0500
commitc92ac9f5cbb4440b5f87c7e0dd6bec5147d72405 (patch)
tree2cd04944fc6132f5abadddbe6d225801385abcac /src/common/memarea.h
parent2f086888b14be3998421b29bfc81d037b8073202 (diff)
downloadtor-c92ac9f5cbb4440b5f87c7e0dd6bec5147d72405.tar.gz
tor-c92ac9f5cbb4440b5f87c7e0dd6bec5147d72405.zip
Convert the rest of src/common's headers to use FREE_AND_NULL
Diffstat (limited to 'src/common/memarea.h')
-rw-r--r--src/common/memarea.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/memarea.h b/src/common/memarea.h
index c3d954e1ce..5207e8a5bd 100644
--- a/src/common/memarea.h
+++ b/src/common/memarea.h
@@ -8,7 +8,12 @@
typedef struct memarea_t memarea_t;
memarea_t *memarea_new(void);
-void memarea_drop_all(memarea_t *area);
+void memarea_drop_all_(memarea_t *area);
+#define memarea_drop_all(area) \
+ do { \
+ memarea_drop_all_(area); \
+ (area) = NULL; \
+ } while (0)
void memarea_clear(memarea_t *area);
int memarea_owns_ptr(const memarea_t *area, const void *ptr);
void *memarea_alloc(memarea_t *area, size_t sz);