blob: 2249b98874d1ac4d1d2bd31832e2ff5cadfbc7d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#include "config.h"
#include "almalloc.h"
#include <new>
#include <cstring>
gsl::owner<void*> al_calloc(size_t alignment, size_t size)
{
gsl::owner<void*> ret{::operator new[](size, std::align_val_t{alignment}, std::nothrow)};
if(ret) std::memset(ret, 0, size);
return ret;
}
|