Blob


1 /*
2 * These are here mainly so that I can link against
3 * debugmalloc.c instead and not recompile the world.
4 */
6 #include <u.h>
7 #define NOPLAN9DEFINES
8 #include <libc.h>
10 void*
11 p9malloc(ulong n)
12 {
13 void *v;
15 if(n == 0)
16 n++;
17 return malloc(n);
18 }
20 void
21 p9free(void *v)
22 {
23 if(v == nil)
24 return;
25 free(v);
26 }
28 void*
29 p9calloc(ulong a, ulong b)
30 {
31 if(a*b == 0)
32 a = b = 1;
34 return calloc(a*b, 1);
35 }
37 void*
38 p9realloc(void *v, ulong n)
39 {
40 return realloc(v, n);
41 }