00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __kmalloc_h
00009 #define __kmalloc_h
00010
00011 #include <utility/heap.h>
00012
00013 __BEGIN_SYS
00014
00015 extern Heap sys_heap;
00016
00017 inline void * kmalloc(unsigned int bytes) {
00018 return sys_heap.alloc(bytes);
00019 }
00020 inline void * kcalloc(unsigned int n, unsigned int bytes) {
00021 return sys_heap.calloc(n * bytes);
00022 }
00023 inline void * krealloc(void * ptr, unsigned int bytes) {
00024 return sys_heap.realloc(ptr, bytes);
00025 }
00026 inline void kfree(void * ptr) {
00027 sys_heap.free(ptr);
00028 }
00029
00030 __END_SYS
00031
00032 #endif
00033