You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rngxx/src/aligned_ptr.cpp

20 lines
348 B

#include <string>
#include <cstdlib>
#include <mem.h>
template<typename T>
static inline T* not_null(T* ptr)
{
if(!ptr) throw "TODO: Nullptr except";
return ptr;
}
namespace mem
{
void* aligned_ptr_util::_alloc(usize a, usize s) { return not_null<void>( aligned_alloc(a, s) ); }
void aligned_ptr_util::_dealloc(void* ptr) { free(ptr); }
}