more checking for --gc:arc, no need for valgrind (#14467)

* sigmatch: removed dead code
This commit is contained in:
Andreas Rumpf 2020-05-29 12:08:17 +02:00 • committed by GitHub
commit e31ac81899
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 159 additions and 73 deletions

View file

@ -38,27 +38,10 @@ type
PByte = ptr ByteArray
PString = ptr string
# Page size of the system; in most cases 4096 bytes. For exotic OS or
# CPU this needs to be changed:
const
PageShift = when defined(cpu16): 8 else: 12 # \
# my tests showed no improvements for using larger page sizes.
PageSize = 1 shl PageShift
PageMask = PageSize-1
MemAlign = 16 # also minimal allocatable memory block
BitsPerPage = PageSize div MemAlign
UnitsPerPage = BitsPerPage div (sizeof(int)*8)
# how many ints do we need to describe a page:
# on 32 bit systems this is only 16 (!)
TrunkShift = 9
BitsPerTrunk = 1 shl TrunkShift # needs to be power of 2 and divisible by 64
TrunkMask = BitsPerTrunk - 1
IntsPerTrunk = BitsPerTrunk div (sizeof(int)*8)
IntShift = 5 + ord(sizeof(int) == 8) # 5 or 6, depending on int width
IntMask = 1 shl IntShift - 1
when declared(IntsPerTrunk):
discard
else:
include bitmasks
proc raiseOutOfMem() {.noinline.} =
if outOfMemHook != nil: outOfMemHook()