[ox/std] Add some notable missing comments
This commit is contained in:
parent
3a70c0972b
commit
87f4964df5
7
deps/ox/src/ox/std/new.hpp
vendored
7
deps/ox/src/ox/std/new.hpp
vendored
@ -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)
|
#if defined(OX_USE_STDLIB)
|
||||||
#define ox_malloca(size, Type, ...) ox::MallocaPtr<Type>(size, new (size > MallocaStackLimit ? new uint8_t[size] : ox_alloca(size)) Type(__VA_ARGS__))
|
#define ox_malloca(size, Type, ...) ox::MallocaPtr<Type>(size, new (size > MallocaStackLimit ? new uint8_t[size] : ox_alloca(size)) Type(__VA_ARGS__))
|
||||||
#else
|
#else
|
||||||
@ -41,6 +44,10 @@ constexpr auto MallocaStackLimit = 1024;
|
|||||||
|
|
||||||
namespace ox {
|
namespace ox {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MallocaPtr will automatically cleanup the pointed to address upon
|
||||||
|
* destruction if the size of the allocation is greater than MallocaStackLimit.
|
||||||
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class MallocaPtr {
|
class MallocaPtr {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user