summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension/malloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/dimension/malloc.h')
-rw-r--r--libdimension/dimension/malloc.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/libdimension/dimension/malloc.h b/libdimension/dimension/malloc.h
index 4151800..742e3a2 100644
--- a/libdimension/dimension/malloc.h
+++ b/libdimension/dimension/malloc.h
@@ -1,5 +1,5 @@
/*************************************************************************
- * Copyright (C) 2010-2011 Tavian Barnes <tavianator@tavianator.com> *
+ * Copyright (C) 2010-2014 Tavian Barnes <tavianator@tavianator.com> *
* *
* This file is part of The Dimension Library. *
* *
@@ -36,6 +36,14 @@
void *dmnsn_malloc(size_t size);
/**
+ * Allocate some memory. Always use dmnsn_free() to free this memory, never
+ * free().
+ * @param[in] type The type of the memory block to allocate.
+ * @return The allocated memory area.
+ */
+#define DMNSN_MALLOC(type) ((type *)dmnsn_malloc(sizeof(type)))
+
+/**
* Expand or shrink an allocation created by dmnsn_malloc().
* @param[in] ptr The block to resize.
* @param[in] size The new size.