mratsim / weave

A state-of-the-art multithreading runtime: message-passing based, fast, scalable, ultra-low overhead
Other
532 stars 22 forks source link

windows aligned_alloc in allocs.nim have different params order compared to docs and malloc.h #162

Closed jangko closed 3 years ago

jangko commented 3 years ago
proc aligned_alloc(alignment, size: csize_t): pointer {.sideeffect,importc:"_aligned_malloc", header:"<malloc.h>".}
void *__cdecl _aligned_malloc(size_t _Size,size_t _Alignment);

The position of alignment and size are swapped. Although the generated ABI is identical, but the meaning of the value is of course totally different.