ali@0
|
1 |
#ifndef GC_MEM_H
|
ali@0
|
2 |
#define GC_MEM_H
|
ali@0
|
3 |
|
ali@0
|
4 |
void *mem_alloc(size_t nmemb,size_t size);
|
ali@0
|
5 |
void *mem_alloc0(size_t nmemb,size_t size);
|
ali@0
|
6 |
void *mem_realloc(void *ptr,size_t nmemb,size_t size);
|
ali@0
|
7 |
|
ali@0
|
8 |
#define mem_new(type,n) ((type *)mem_alloc(n,sizeof(type)))
|
ali@0
|
9 |
#define mem_new0(type,n) ((type *)mem_alloc0(n,sizeof(type)))
|
ali@0
|
10 |
#define mem_renew(type,ptr,n) ((type *)mem_realloc(ptr,n,sizeof(type)))
|
ali@0
|
11 |
#define mem_free(ptr) free(ptr)
|
ali@0
|
12 |
|
ali@0
|
13 |
#endif /* GC_MEM_H */
|