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 if(n == 0)
14 n++;
15 return malloc(n);
16 }
18 void
19 p9free(void *v)
20 {
21 if(v == nil)
22 return;
23 free(v);
24 }
26 void*
27 p9calloc(ulong a, ulong b)
28 {
29 if(a*b == 0)
30 a = b = 1;
32 return calloc(a*b, 1);
33 }
35 void*
36 p9realloc(void *v, ulong n)
37 {
38 return realloc(v, n);
39 }