X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/35a7d633d3f16c1e0539af6ca5d8e7482926cd93..9daf4fcdae88f72af60aeb0c7722841af02233d4:/lunaix-os/tests/units/stubs/valloc.c?ds=sidebyside diff --git a/lunaix-os/tests/units/stubs/valloc.c b/lunaix-os/tests/units/stubs/valloc.c new file mode 100644 index 0000000..0d02922 --- /dev/null +++ b/lunaix-os/tests/units/stubs/valloc.c @@ -0,0 +1,66 @@ +#include +#include + +extern void *malloc(size_t); +extern void *calloc(size_t, size_t); +extern void free(void*); + +void* +valloc(unsigned int size) +{ + return malloc(size); +} + +void* +vzalloc(unsigned int size) +{ + return calloc(size, 1); +} + +void* +vcalloc(unsigned int size, unsigned int count) +{ + return calloc(size, count); +} + +void +vfree(void* ptr) +{ + free(ptr); +} + +void +vfree_safe(void* ptr) +{ + if (ptr) free(ptr); +} + +void* +valloc_dma(unsigned int size) +{ + return malloc(size); +} + +void* +vzalloc_dma(unsigned int size) +{ + return calloc(size, 1); +} + +void +vfree_dma(void* ptr) +{ + free(ptr); +} + +void +valloc_init() +{ + return; +} + +void +valloc_ensure_valid(void* ptr) +{ + return; +} \ No newline at end of file