mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
(cherry picked from commit edce5897a5)
This commit is contained in:
@@ -247,7 +247,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)
|
||||
@@ -270,7 +270,7 @@ 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
|
||||
@@ -278,7 +278,7 @@ proc allocAvlNode(a: var MemRegion, key, upperBound: int): PAvlNode =
|
||||
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]")
|
||||
@@ -987,7 +987,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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -30,7 +30,7 @@ const
|
||||
coalescRight = true
|
||||
coalescLeft = true
|
||||
logAlloc = false
|
||||
useCellIds = defined(corruption)
|
||||
useCellIds = defined(nimCorruption)
|
||||
|
||||
type
|
||||
PPointer = ptr pointer
|
||||
|
||||
Reference in New Issue
Block a user