avoid X86 specific code on ARM

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2022-05-17 15:15:01 +02:00
parent 41cd86df5b
commit e0e642e978
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E
2 changed files with 11 additions and 5 deletions

View File

@ -1,4 +1,7 @@
import ./utils/allocs
import ./utils/cpuinfo_x86
export cpuinfo_x86, allocs
when defined(amd64) or defined(i386):
import ./utils/cpuinfo_x86
export cpuinfo_x86
export allocs

View File

@ -14,12 +14,15 @@ push: {.upraises: [].}
import system/ansi_c
import ./cpuinfo_x86
when defined(amd64) or defined(i386):
import ./cpuinfo_x86
## inspired by https://github.com/mratsim/weave/blob/master/weave/memory/allocs.nim
let
LeoAlignBytes* = if hasAvx2(): 32'u else: 16'u
when defined(amd64) or defined(i386):
let LeoAlignBytes* = if hasAvx2(): 32'u else: 16'u
else:
let LeoAlignBytes* = 16'u
when defined(windows):
proc alignedAllocWindows(size, alignment: csize_t): pointer