implement posix_memalign on Windows for sizecheck

develop
Ben Lubar 2020-03-26 17:46:00 -05:00
parent 63f774dfef
commit 90e0c29a5c
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
1 changed files with 12 additions and 0 deletions

@ -23,6 +23,18 @@ void init() {
initialized = true; initialized = true;
} }
#ifdef _WIN32
static int posix_memalign(void **ptr, size_t alignment, size_t size)
{
if ((*ptr = _aligned_malloc(size, alignment)))
{
return 0;
}
return errno;
}
#endif
void* alloc(size_t n) { void* alloc(size_t n) {
if (!initialized) { if (!initialized) {
init(); init();