summaryrefslogtreecommitdiffstats
path: root/malloc.h
blob: df459ed4eccd2fc74f6ee7c983a1036de0c602c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef foomallochfoo
#define foomallochfoo

#include <stdlib.h>
#include <string.h>

#define sa_malloc malloc
#define sa_free free
#define sa_malloc0(size) calloc(1, (size))
#define sa_strdup strdup

void* sa_memdup(const void* p, size_t size);

#define sa_new(t, n) ((t*) sa_malloc(sizeof(t)*n))

#endif