cosmopolitan/third_party/dlmalloc/dlpvalloc.c

11 lines
294 B
C
Raw Normal View History

2020-06-15 14:18:57 +00:00
#include "libc/mem/mem.h"
#include "third_party/dlmalloc/dlmalloc.internal.h"
2020-06-15 14:18:57 +00:00
void *dlpvalloc(size_t bytes) {
size_t pagesz;
ensure_initialization();
pagesz = g_mparams.page_size;
2020-06-15 14:18:57 +00:00
return dlmemalign(pagesz,
(bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE));
}