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

21 lines
378 B

#include <string>
#include <cstdlib>
#include <common.h>
#include <mem.h>
template<typename T>
static inline T* not_null(T* ptr)
{
if(UNLIKELY(!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); }
}