mirror of
https://github.com/logos-storage/nim-leopard.git
synced 2026-01-05 23:23:07 +00:00
remove sideeffects pragma
This commit is contained in:
parent
dc89d8346e
commit
e91a31447d
@ -26,14 +26,14 @@ when defined(windows):
|
|||||||
alignedAllocWindows(size, alignment)
|
alignedAllocWindows(size, alignment)
|
||||||
|
|
||||||
proc alignedAllocWindows(size, alignment: csize_t): pointer
|
proc alignedAllocWindows(size, alignment: csize_t): pointer
|
||||||
{.sideeffect, importc: "_aligned_malloc", header: "<malloc.h>".}
|
{.importc: "_aligned_malloc", header: "<malloc.h>".}
|
||||||
# Beware of the arg order!
|
# Beware of the arg order!
|
||||||
|
|
||||||
proc alignedFree*[T](p: ptr T)
|
proc alignedFree*[T](p: ptr T)
|
||||||
{.sideeffect, importc: "_aligned_free", header: "<malloc.h>".}
|
{.importc: "_aligned_free", header: "<malloc.h>".}
|
||||||
elif defined(osx):
|
elif defined(osx):
|
||||||
proc posix_memalign(mem: var pointer, alignment, size: csize_t)
|
proc posix_memalign(mem: var pointer, alignment, size: csize_t)
|
||||||
{.sideeffect, importc, header:"<stdlib.h>".}
|
{.importc, header:"<stdlib.h>".}
|
||||||
|
|
||||||
proc alignedAlloc(alignment, size: csize_t): pointer {.inline.} =
|
proc alignedAlloc(alignment, size: csize_t): pointer {.inline.} =
|
||||||
posix_memalign(result, alignment, size)
|
posix_memalign(result, alignment, size)
|
||||||
@ -42,10 +42,10 @@ elif defined(osx):
|
|||||||
c_free(p)
|
c_free(p)
|
||||||
elif defined(unix):
|
elif defined(unix):
|
||||||
proc alignedAlloc(alignment, size: csize_t): pointer
|
proc alignedAlloc(alignment, size: csize_t): pointer
|
||||||
{.sideeffect, importc: "aligned_alloc", header: "<stdlib.h>".}
|
{.importc: "aligned_alloc", header: "<stdlib.h>".}
|
||||||
|
|
||||||
proc alignedFree*[T](p: ptr T) {.inline.} =
|
proc alignedFree*[T](p: ptr T) {.inline.} =
|
||||||
{.sideeffect, importc: "free_aligned", header: "<stdlib.h>".}
|
{.importc: "free_aligned", header: "<stdlib.h>".}
|
||||||
c_free(p)
|
c_free(p)
|
||||||
else:
|
else:
|
||||||
{.warning: "Falling back to manual pointer alignment, might end-up using more memory!".}
|
{.warning: "Falling back to manual pointer alignment, might end-up using more memory!".}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user