dirty changes to Nim's memory tracker; requires cleanups
This commit is contained in:
parent
51c764e048
commit
082f6f15e7
1 changed files with 6 additions and 1 deletions
|
|
@ -62,12 +62,17 @@ proc addEntry(entry: LogEntry) =
|
||||||
interesting = true
|
interesting = true
|
||||||
break
|
break
|
||||||
if interesting:
|
if interesting:
|
||||||
cprintf("interesting %s:%ld\n", entry.file, entry.line)
|
gLog.disabled = true
|
||||||
|
cprintf("interesting %s:%ld %s\n", entry.file, entry.line, entry.op)
|
||||||
|
let x = cast[proc() {.nimcall, tags: [], gcsafe, locks: 0.}](writeStackTrace)
|
||||||
|
x()
|
||||||
|
quit 1
|
||||||
if gLog.count > high(gLog.data):
|
if gLog.count > high(gLog.data):
|
||||||
gLogger(gLog)
|
gLogger(gLog)
|
||||||
gLog.count = 0
|
gLog.count = 0
|
||||||
gLog.data[gLog.count] = entry
|
gLog.data[gLog.count] = entry
|
||||||
inc gLog.count
|
inc gLog.count
|
||||||
|
gLog.disabled = false
|
||||||
|
|
||||||
proc memTrackerWrite(address: pointer; size: int; file: cstring; line: int) {.compilerProc.} =
|
proc memTrackerWrite(address: pointer; size: int; file: cstring; line: int) {.compilerProc.} =
|
||||||
addEntry LogEntry(op: "write", address: address,
|
addEntry LogEntry(op: "write", address: address,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue