From 7d83e5c7816b5e343695a75ba58b32dbe1be969a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 1 Oct 2007 20:16:28 +0000 Subject: move all sources down to a seperate src/ tree git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@34 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce --- src/malloc.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/malloc.h (limited to 'src/malloc.h') diff --git a/src/malloc.h b/src/malloc.h new file mode 100644 index 0000000..bcaf53e --- /dev/null +++ b/src/malloc.h @@ -0,0 +1,19 @@ +#ifndef foomallochfoo +#define foomallochfoo + +#include +#include + +#define sa_malloc malloc +#define sa_free free +#define sa_malloc0(size) calloc(1, (size)) +#define sa_strdup strdup +#define sa_strndup strndup + +void* sa_memdup(const void* p, size_t size); + +#define sa_new(t, n) ((t*) sa_malloc(sizeof(t)*(n))) +#define sa_new0(t, n) ((t*) sa_malloc0(sizeof(t)*(n))) +#define sa_newdup(t, p, n) ((t*) sa_memdup(p, sizeof(t)*(n))) + +#endif -- cgit