]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/cc/compat.c
merge
[plan9front.git] / sys / src / cmd / cc / compat.c
1 #include        "cc.h"
2 #include        "compat"
3
4 /*
5  * fake mallocs
6  */
7 void*
8 malloc(ulong n)
9 {
10         return alloc(n);
11 }
12
13 void*
14 calloc(ulong m, ulong n)
15 {
16         return alloc(m*n);
17 }
18
19 void*
20 realloc(void*, ulong)
21 {
22         fprint(2, "realloc called\n");
23         abort();
24         return 0;
25 }
26
27 void
28 free(void*)
29 {
30 }
31
32 /* needed when profiling */
33 void*
34 mallocz(ulong size, int clr)
35 {
36         void *v;
37
38         v = alloc(size);
39         if(clr && v != nil)
40                 memset(v, 0, size);
41         return v;
42 }
43
44 void
45 setmalloctag(void*, ulong)
46 {
47 }