mirror of
https://github.com/drasko/codezero.git
synced 2026-07-11 18:04:27 +02:00
Added posix code
This commit is contained in:
20
conts/posix/mm0/include/lib/malloc.h
Normal file
20
conts/posix/mm0/include/lib/malloc.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef __PRIVATE_MALLOC_H__
|
||||
#define __PRIVATE_MALLOC_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void *kmalloc(size_t size);
|
||||
void kfree(void *blk);
|
||||
|
||||
static inline void *kzalloc(size_t size)
|
||||
{
|
||||
void *buf = kmalloc(size);
|
||||
|
||||
memset(buf, 0, size);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
#endif /*__PRIVATE_MALLOC_H__ */
|
||||
Reference in New Issue
Block a user