diff --git a/deps/ox/src/ox/std/new.hpp b/deps/ox/src/ox/std/new.hpp index 175c0a9d..67d0e12b 100644 --- a/deps/ox/src/ox/std/new.hpp +++ b/deps/ox/src/ox/std/new.hpp @@ -33,6 +33,9 @@ constexpr auto MallocaStackLimit = 1024; } +/** + * @return an ox::MallocaPtr of the given type pointing to the requested size memory allocation + */ #if defined(OX_USE_STDLIB) #define ox_malloca(size, Type, ...) ox::MallocaPtr(size, new (size > MallocaStackLimit ? new uint8_t[size] : ox_alloca(size)) Type(__VA_ARGS__)) #else @@ -41,6 +44,10 @@ constexpr auto MallocaStackLimit = 1024; namespace ox { +/** + * MallocaPtr will automatically cleanup the pointed to address upon + * destruction if the size of the allocation is greater than MallocaStackLimit. + */ template class MallocaPtr {