mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 00:49:08 +00:00
feat(memory): add SMemFill
This commit is contained in:
parent
8e9fb741b6
commit
2efa5339e2
3 changed files with 29 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
#include "storm/Memory.hpp"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
constexpr size_t ALIGNMENT = 8;
|
||||
|
||||
void* SMemAlloc(size_t bytes, const char* filename, int32_t linenumber, uint32_t flags) {
|
||||
|
|
@ -21,6 +23,10 @@ void* SMemAlloc(size_t bytes, const char* filename, int32_t linenumber, uint32_t
|
|||
}
|
||||
}
|
||||
|
||||
void SMemFill(void* ptr, size_t bytes, uint8_t value) {
|
||||
memset(ptr, value, bytes);
|
||||
}
|
||||
|
||||
void SMemFree(void* ptr) {
|
||||
if (ptr) {
|
||||
free(ptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue