aboutsummaryrefslogtreecommitdiff
path: root/memory.h
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-05-18 06:46:55 +0100
committerSimon Tatham <anakin@pobox.com>2017-05-18 06:46:55 +0100
commit9e3e915426cb9ef8fd6f6689e12affb6288c5a8a (patch)
tree2da97d3419ee15fd0c0089d81d89bf74aeb26961 /memory.h
parentca59ebf60df4ef45a1e4d681980e29e3db853bba (diff)
downloadwix-on-linux-9e3e915426cb9ef8fd6f6689e12affb6288c5a8a.tar.gz
wix-on-linux-9e3e915426cb9ef8fd6f6689e12affb6288c5a8a.tar.bz2
wix-on-linux-9e3e915426cb9ef8fd6f6689e12affb6288c5a8a.zip
Move snew/sfree out into their own header+src.
Diffstat (limited to '')
-rw-r--r--memory.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/memory.h b/memory.h
new file mode 100644
index 0000000..77e153e
--- /dev/null
+++ b/memory.h
@@ -0,0 +1,9 @@
1#include <stdlib.h>
2
3void *smalloc(size_t size);
4void *srealloc(void *ptr, size_t size);
5
6#define snew(type) ((type *)smalloc(sizeof(type)))
7#define snewn(n,type) ((type *)smalloc((n)*sizeof(type)))
8#define sresize(ptr,n,type) ((type *)srealloc(ptr,(n)*sizeof(type)))
9#define sfree(ptr) free(ptr)