Add memory function
This commit is contained in:
@@ -1 +1,27 @@
|
||||
#include "memory.h"
|
||||
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
|
||||
void *bzAlloc(size_t numBytes) {
|
||||
return malloc(numBytes);
|
||||
}
|
||||
void bzFree(void *ptr) {
|
||||
free(ptr);
|
||||
}
|
||||
void *bzCalloc(size_t numBytes, size_t count) {
|
||||
return calloc(numBytes, count);
|
||||
}
|
||||
void *bzResize(void *ptr, size_t newSize) {
|
||||
return realloc(ptr, newSize);
|
||||
}
|
||||
|
||||
void *bzMemSet(void *ptr, int value, size_t numBytes) {
|
||||
return memset(ptr, value, numBytes);
|
||||
}
|
||||
void *bzMemMove(void *dst, void *src, size_t numBytes) {
|
||||
return memmove(dst, src, numBytes);
|
||||
}
|
||||
void *bzMemCpy(void *dst, void *src, size_t numBytes) {
|
||||
return memcpy(dst, src, numBytes);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
#ifndef BREEZE_MEMORY_H
|
||||
#define BREEZE_MEMORY_H
|
||||
|
||||
#include "../defines.h"
|
||||
|
||||
void *bzAlloc(size_t numBytes);
|
||||
void bzFree(void *ptr);
|
||||
void *bzCalloc(size_t numBytes, size_t count);
|
||||
void *bzResize(void *ptr, size_t newSize);
|
||||
|
||||
void *bzMemSet(void *ptr, int value, size_t numBytes);
|
||||
void *bzMemMove(void *dst, void *src, size_t numBytes);
|
||||
void *bzMemCpy(void *dst, void *src, size_t numBytes);
|
||||
|
||||
|
||||
#endif //BREEZE_MEMORY_H
|
||||
|
||||
Reference in New Issue
Block a user