blob: a32178b3bc2d8f60bd7843061c433fee9293d6c3 [file] [log] [blame]
rsc9c635582004-06-09 14:22:08 +00001/*
2 * These are here mainly so that I can link against
3 * debugmalloc.c instead and not recompile the world.
4 */
5
rscb3994ec2003-12-11 17:50:28 +00006#include <u.h>
7#define NOPLAN9DEFINES
8#include <libc.h>
9
10void*
11p9malloc(ulong n)
12{
13 if(n == 0)
14 n++;
rsc9c635582004-06-09 14:22:08 +000015 return malloc(n);
rsc7e0e6522004-05-23 00:58:23 +000016}
17
18void
19p9free(void *v)
20{
rsc9c635582004-06-09 14:22:08 +000021 if(v == nil)
22 return;
rsc7e0e6522004-05-23 00:58:23 +000023 free(v);
rsc7e0e6522004-05-23 00:58:23 +000024}
25
26void*
27p9calloc(ulong a, ulong b)
28{
rsc9c635582004-06-09 14:22:08 +000029 if(a*b == 0)
30 a = b = 1;
rsc7e0e6522004-05-23 00:58:23 +000031
rsc9c635582004-06-09 14:22:08 +000032 return calloc(a*b, 1);
rsc7e0e6522004-05-23 00:58:23 +000033}
34
35void*
36p9realloc(void *v, ulong n)
37{
rsc9c635582004-06-09 14:22:08 +000038 return realloc(v, n);
rscb3994ec2003-12-11 17:50:28 +000039}