Skip to content

Commit

Permalink
fixes #16214 [backport] (#16252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq authored Dec 4, 2020
1 parent 6877e0c commit edce589
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/system/alloc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ proc llAlloc(a: var MemRegion, size: int): pointer =
sysAssert roundup(size+sizeof(LLChunk), PageSize) == PageSize, "roundup 6"
var old = a.llmem # can be nil and is correct with nil
a.llmem = cast[PLLChunk](osAllocPages(PageSize))
when defined(avlcorruption):
when defined(nimAvlcorruption):
trackLocation(a.llmem, PageSize)
incCurrMem(a, PageSize)
a.llmem.size = PageSize - sizeof(LLChunk)
Expand All @@ -276,15 +276,15 @@ proc allocAvlNode(a: var MemRegion, key, upperBound: int): PAvlNode =
a.freeAvlNodes = a.freeAvlNodes.link[0]
else:
result = cast[PAvlNode](llAlloc(a, sizeof(AvlNode)))
when defined(avlcorruption):
when defined(nimAvlcorruption):
cprintf("tracking location: %p\n", result)
result.key = key
result.upperBound = upperBound
let bottom = getBottom(a)
result.link[0] = bottom
result.link[1] = bottom
result.level = 1
#when defined(avlcorruption):
#when defined(nimAvlcorruption):
# track("allocAvlNode", result, sizeof(AvlNode))
sysAssert(bottom == addr(a.bottomData), "bottom data")
sysAssert(bottom.link[0] == bottom, "bottom link[0]")
Expand Down Expand Up @@ -1017,7 +1017,7 @@ when defined(nimTypeNames):
template instantiateForRegion(allocator: untyped) {.dirty.} =
{.push stackTrace: off.}

when defined(fulldebug):
when defined(nimFulldebug):
proc interiorAllocatedPtr*(p: pointer): pointer =
result = interiorAllocatedPtr(allocator, p)

Expand Down
8 changes: 4 additions & 4 deletions lib/system/mmdisp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const
debugGC = false # we wish to debug the GC...
logGC = false
traceGC = false # extensive debugging
alwaysCycleGC = defined(smokeCycles)
alwaysGC = defined(fulldebug) # collect after every memory
alwaysCycleGC = defined(nimSmokeCycles)
alwaysGC = defined(nimFulldebug) # collect after every memory
# allocation (for debugging)
leakDetector = defined(leakDetector)
leakDetector = defined(nimLeakDetector)
overwriteFree = defined(nimBurnFree) # overwrite memory with 0xFF before free
trackAllocationSource = leakDetector

Expand All @@ -30,7 +30,7 @@ const
coalescRight = true
coalescLeft = true
logAlloc = false
useCellIds = defined(corruption)
useCellIds = defined(nimCorruption)

type
PPointer = ptr pointer
Expand Down

0 comments on commit edce589

Please sign in to comment.