diff options
author | Lennart Poettering <lennart@poettering.net> | 2008-04-11 15:36:25 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-04-11 15:36:25 +0000 |
commit | 1559476e75534b4b4896a9fdb08f78af0ad7882e (patch) | |
tree | cb36479c0aa64d63188f3965e7458d440abdc833 /malloc.h | |
parent | fa49d80fd0bd59b54dd97351057f2b9bb9db60cc (diff) |
commit what i prepared a while back
git-svn-id: file:///home/lennart/svn/public/libcanberra/trunk@5 01b60673-d06a-42c0-afdd-89cb8e0f78ac
Diffstat (limited to 'malloc.h')
-rw-r--r-- | malloc.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/malloc.h b/malloc.h new file mode 100644 index 0000000..f87b85b --- /dev/null +++ b/malloc.h @@ -0,0 +1,20 @@ +#ifndef foosydneymallochfoo +#define foocanberramallochfoo + +#include <stdlib.h> +#include <string.h> + +#define ca_malloc malloc +#define ca_free free +#define ca_malloc0(size) calloc(1, (size)) +#define ca_strdup strdup +#define ca_strndup strndup + +void* ca_memdup(const void* p, size_t size); + +#define ca_new(t, n) ((t*) ca_malloc(sizeof(t)*(n))) +#define ca_new0(t, n) ((t*) ca_malloc0(sizeof(t)*(n))) +#define ca_newdup(t, p, n) ((t*) ca_memdup(p, sizeof(t)*(n))) + +#endif +~ |