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.
20 lines
352 B
20 lines
352 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<void >::_alloc(usize a, usize s) { return not_null<void>( aligned_alloc(a, s) ); }
|
|
void aligned_ptr<void >::_dealloc(void* ptr) { free(ptr); }
|
|
}
|
|
|