This commit is contained in:
Araq
2017-10-16 12:29:40 +02:00
parent 06854d1346
commit 4a7266e1c1
2 changed files with 17 additions and 15 deletions

View File

@@ -301,13 +301,14 @@ proc pageAddr(p: pointer): PChunk {.inline.} =
result = cast[PChunk](cast[ByteAddress](p) and not PageMask)
#sysAssert(Contains(allocator.chunkStarts, pageIndex(result)))
proc writeFreeList(a: MemRegion) =
var it = a.freeChunksList
c_fprintf(stdout, "freeChunksList: %p\n", it)
while it != nil:
c_fprintf(stdout, "it: %p, next: %p, prev: %p, size: %ld\n",
it, it.next, it.prev, it.size)
it = it.next
when false:
proc writeFreeList(a: MemRegion) =
var it = a.freeChunksList
c_fprintf(stdout, "freeChunksList: %p\n", it)
while it != nil:
c_fprintf(stdout, "it: %p, next: %p, prev: %p, size: %ld\n",
it, it.next, it.prev, it.size)
it = it.next
const nimMaxHeap {.intdefine.} = 0

View File

@@ -155,14 +155,15 @@ template setColor(c, col) =
else:
c.refcount = c.refcount and not colorMask or col
proc writeCell(msg: cstring, c: PCell) =
var kind = -1
var typName: cstring = "nil"
if c.typ != nil:
kind = ord(c.typ.kind)
when defined(nimTypeNames):
if not c.typ.name.isNil:
typName = c.typ.name
when defined(logGC):
proc writeCell(msg: cstring, c: PCell) =
var kind = -1
var typName: cstring = "nil"
if c.typ != nil:
kind = ord(c.typ.kind)
when defined(nimTypeNames):
if not c.typ.name.isNil:
typName = c.typ.name
when leakDetector:
c_fprintf(stdout, "[GC] %s: %p %d %s rc=%ld from %s(%ld)\n",