parent
6877e0c8a3
commit
edce5897a5
2 changed files with 8 additions and 8 deletions
|
|
@ -253,7 +253,7 @@ proc llAlloc(a: var MemRegion, size: int): pointer =
|
||||||
sysAssert roundup(size+sizeof(LLChunk), PageSize) == PageSize, "roundup 6"
|
sysAssert roundup(size+sizeof(LLChunk), PageSize) == PageSize, "roundup 6"
|
||||||
var old = a.llmem # can be nil and is correct with nil
|
var old = a.llmem # can be nil and is correct with nil
|
||||||
a.llmem = cast[PLLChunk](osAllocPages(PageSize))
|
a.llmem = cast[PLLChunk](osAllocPages(PageSize))
|
||||||
when defined(avlcorruption):
|
when defined(nimAvlcorruption):
|
||||||
trackLocation(a.llmem, PageSize)
|
trackLocation(a.llmem, PageSize)
|
||||||
incCurrMem(a, PageSize)
|
incCurrMem(a, PageSize)
|
||||||
a.llmem.size = PageSize - sizeof(LLChunk)
|
a.llmem.size = PageSize - sizeof(LLChunk)
|
||||||
|
|
@ -276,7 +276,7 @@ proc allocAvlNode(a: var MemRegion, key, upperBound: int): PAvlNode =
|
||||||
a.freeAvlNodes = a.freeAvlNodes.link[0]
|
a.freeAvlNodes = a.freeAvlNodes.link[0]
|
||||||
else:
|
else:
|
||||||
result = cast[PAvlNode](llAlloc(a, sizeof(AvlNode)))
|
result = cast[PAvlNode](llAlloc(a, sizeof(AvlNode)))
|
||||||
when defined(avlcorruption):
|
when defined(nimAvlcorruption):
|
||||||
cprintf("tracking location: %p\n", result)
|
cprintf("tracking location: %p\n", result)
|
||||||
result.key = key
|
result.key = key
|
||||||
result.upperBound = upperBound
|
result.upperBound = upperBound
|
||||||
|
|
@ -284,7 +284,7 @@ proc allocAvlNode(a: var MemRegion, key, upperBound: int): PAvlNode =
|
||||||
result.link[0] = bottom
|
result.link[0] = bottom
|
||||||
result.link[1] = bottom
|
result.link[1] = bottom
|
||||||
result.level = 1
|
result.level = 1
|
||||||
#when defined(avlcorruption):
|
#when defined(nimAvlcorruption):
|
||||||
# track("allocAvlNode", result, sizeof(AvlNode))
|
# track("allocAvlNode", result, sizeof(AvlNode))
|
||||||
sysAssert(bottom == addr(a.bottomData), "bottom data")
|
sysAssert(bottom == addr(a.bottomData), "bottom data")
|
||||||
sysAssert(bottom.link[0] == bottom, "bottom link[0]")
|
sysAssert(bottom.link[0] == bottom, "bottom link[0]")
|
||||||
|
|
@ -1017,7 +1017,7 @@ when defined(nimTypeNames):
|
||||||
template instantiateForRegion(allocator: untyped) {.dirty.} =
|
template instantiateForRegion(allocator: untyped) {.dirty.} =
|
||||||
{.push stackTrace: off.}
|
{.push stackTrace: off.}
|
||||||
|
|
||||||
when defined(fulldebug):
|
when defined(nimFulldebug):
|
||||||
proc interiorAllocatedPtr*(p: pointer): pointer =
|
proc interiorAllocatedPtr*(p: pointer): pointer =
|
||||||
result = interiorAllocatedPtr(allocator, p)
|
result = interiorAllocatedPtr(allocator, p)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ const
|
||||||
debugGC = false # we wish to debug the GC...
|
debugGC = false # we wish to debug the GC...
|
||||||
logGC = false
|
logGC = false
|
||||||
traceGC = false # extensive debugging
|
traceGC = false # extensive debugging
|
||||||
alwaysCycleGC = defined(smokeCycles)
|
alwaysCycleGC = defined(nimSmokeCycles)
|
||||||
alwaysGC = defined(fulldebug) # collect after every memory
|
alwaysGC = defined(nimFulldebug) # collect after every memory
|
||||||
# allocation (for debugging)
|
# allocation (for debugging)
|
||||||
leakDetector = defined(leakDetector)
|
leakDetector = defined(nimLeakDetector)
|
||||||
overwriteFree = defined(nimBurnFree) # overwrite memory with 0xFF before free
|
overwriteFree = defined(nimBurnFree) # overwrite memory with 0xFF before free
|
||||||
trackAllocationSource = leakDetector
|
trackAllocationSource = leakDetector
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ const
|
||||||
coalescRight = true
|
coalescRight = true
|
||||||
coalescLeft = true
|
coalescLeft = true
|
||||||
logAlloc = false
|
logAlloc = false
|
||||||
useCellIds = defined(corruption)
|
useCellIds = defined(nimCorruption)
|
||||||
|
|
||||||
type
|
type
|
||||||
PPointer = ptr pointer
|
PPointer = ptr pointer
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue