]> git.saurik.com Git - apple/boot.git/blob - gen/libsa/malloc.c.00
boot-93.tar.gz
[apple/boot.git] / gen / libsa / malloc.c.00
1 /*
2 * Copyright 1993 NeXT, Inc.
3 * All rights reserved.
4 *
5 * Malloc interface to zalloc.
6 */
7
8 #import "libsa.h"
9
10 int
11 malloc_init(
12 char *start,
13 int size,
14 int nodes
15 )
16 {
17 return zinit(start,size,nodes);
18 }
19
20 void *malloc(size_t size)
21 {
22 return zalloc(size);
23 }
24
25 /* This is the simplest way possible. Should fix this. */
26 void *realloc(void *start, size_t newsize)
27 {
28 void *newstart = zalloc(newsize);
29 bcopy(start, newstart, newsize);
30 zfree(start);
31 return newstart;
32 }
33
34 void free(void *start)
35 {
36 (void) zfree(start);
37 }