Moving some scene files around

This commit is contained in:
2023-07-03 23:05:59 -07:00
parent 71c9f5309b
commit 6de9e3a67f
5 changed files with 29 additions and 5 deletions

View File

@ -8,6 +8,10 @@
#pragma once
#include "assert/assert.hpp"
#if DAWN_DEBUG_BUILD
extern uint64_t dawnAllocatedItemCount;
#endif
/**
* Allocate some space in memory to use for your needs. Memory allocation may
* change how it functions later on to keep things nice and efficient. For now
@ -18,6 +22,9 @@
*/
static inline void * memoryAllocate(const size_t size) {
assertTrue(size > 0);
#if DAWN_DEBUG_BUILD
dawnAllocatedItemCount++;
#endif
auto x = (void *)malloc(size);
assertNotNull(x);
return x;
@ -31,6 +38,9 @@ static inline void * memoryAllocate(const size_t size) {
*/
static inline void * memoryFillWithZero(const size_t size) {
assertTrue(size > 0);
#if DAWN_DEBUG_BUILD
dawnAllocatedItemCount++;
#endif
auto x =(void *)calloc(1, size);
assertNotNull(x);
return x;
@ -43,6 +53,9 @@ static inline void * memoryFillWithZero(const size_t size) {
*/
static inline void memoryFree(void *pointer) {
assertNotNull(pointer);
#if DAWN_DEBUG_BUILD
dawnAllocatedItemCount--;
#endif
free(pointer);
}