mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-03 18:34:43 +00:00
fixes #3558
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user