aboutsummaryrefslogtreecommitdiff
path: root/src/core/defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/defs.h')
-rw-r--r--src/core/defs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/defs.h b/src/core/defs.h
index 9687215d..0fe894b1 100644
--- a/src/core/defs.h
+++ b/src/core/defs.h
@@ -39,4 +39,8 @@ typedef int64_t nni_duration; // Relative time (usec).
#define NNI_TIME_ZERO ((nni_time) 0)
#define NNI_SECOND (1000000)
+// Structure allocation conveniences.
+#define NNI_ALLOC_STRUCT(s) nni_alloc(sizeof (*(s)))
+#define NNI_FREE_STRUCT(s) nni_free((s), sizeof (*(s)))
+
#endif // CORE_DEFS_H