Moving some scene files around
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user