compiler warns when you use GC'ed memory and '--gc:none'
This commit is contained in:
parent
73c6efdf66
commit
15859d94ec
5 changed files with 69 additions and 50 deletions
|
|
@ -847,6 +847,9 @@ proc genEcho(p: BProc, n: PNode) =
|
||||||
linefmt(p, cpsStmts, "printf($1$2);$n",
|
linefmt(p, cpsStmts, "printf($1$2);$n",
|
||||||
makeCString(repeatStr(n.len-1, "%s") & tnl), args)
|
makeCString(repeatStr(n.len-1, "%s") & tnl), args)
|
||||||
|
|
||||||
|
proc gcUsage(n: PNode) =
|
||||||
|
if gSelectedGC == gcNone: message(n.info, warnGcMem, n.renderTree)
|
||||||
|
|
||||||
proc genStrConcat(p: BProc, e: PNode, d: var TLoc) =
|
proc genStrConcat(p: BProc, e: PNode, d: var TLoc) =
|
||||||
# <Nimrod code>
|
# <Nimrod code>
|
||||||
# s = 'Hello ' & name & ', how do you feel?' & 'z'
|
# s = 'Hello ' & name & ', how do you feel?' & 'z'
|
||||||
|
|
@ -888,6 +891,7 @@ proc genStrConcat(p: BProc, e: PNode, d: var TLoc) =
|
||||||
keepAlive(p, tmp)
|
keepAlive(p, tmp)
|
||||||
else:
|
else:
|
||||||
genAssignment(p, d, tmp, {needToKeepAlive}) # no need for deep copying
|
genAssignment(p, d, tmp, {needToKeepAlive}) # no need for deep copying
|
||||||
|
gcUsage(e)
|
||||||
|
|
||||||
proc genStrAppend(p: BProc, e: PNode, d: var TLoc) =
|
proc genStrAppend(p: BProc, e: PNode, d: var TLoc) =
|
||||||
# <Nimrod code>
|
# <Nimrod code>
|
||||||
|
|
@ -925,6 +929,7 @@ proc genStrAppend(p: BProc, e: PNode, d: var TLoc) =
|
||||||
rdLoc(dest), lens, toRope(L))
|
rdLoc(dest), lens, toRope(L))
|
||||||
keepAlive(p, dest)
|
keepAlive(p, dest)
|
||||||
app(p.s(cpsStmts), appends)
|
app(p.s(cpsStmts), appends)
|
||||||
|
gcUsage(e)
|
||||||
|
|
||||||
proc genSeqElemAppend(p: BProc, e: PNode, d: var TLoc) =
|
proc genSeqElemAppend(p: BProc, e: PNode, d: var TLoc) =
|
||||||
# seq &= x -->
|
# seq &= x -->
|
||||||
|
|
@ -945,6 +950,7 @@ proc genSeqElemAppend(p: BProc, e: PNode, d: var TLoc) =
|
||||||
initLoc(dest, locExpr, b.t, OnHeap)
|
initLoc(dest, locExpr, b.t, OnHeap)
|
||||||
dest.r = rfmt(nil, "$1->data[$1->$2-1]", rdLoc(a), lenField())
|
dest.r = rfmt(nil, "$1->data[$1->$2-1]", rdLoc(a), lenField())
|
||||||
genAssignment(p, dest, b, {needToCopy, afDestIsNil})
|
genAssignment(p, dest, b, {needToCopy, afDestIsNil})
|
||||||
|
gcUsage(e)
|
||||||
|
|
||||||
proc genReset(p: BProc, n: PNode) =
|
proc genReset(p: BProc, n: PNode) =
|
||||||
var a: TLoc
|
var a: TLoc
|
||||||
|
|
@ -987,6 +993,7 @@ proc genNew(p: BProc, e: PNode) =
|
||||||
rawGenNew(p, a, se.rdLoc)
|
rawGenNew(p, a, se.rdLoc)
|
||||||
else:
|
else:
|
||||||
rawGenNew(p, a, nil)
|
rawGenNew(p, a, nil)
|
||||||
|
gcUsage(e)
|
||||||
|
|
||||||
proc genNewSeqAux(p: BProc, dest: TLoc, length: PRope) =
|
proc genNewSeqAux(p: BProc, dest: TLoc, length: PRope) =
|
||||||
let seqtype = skipTypes(dest.t, abstractVarRange)
|
let seqtype = skipTypes(dest.t, abstractVarRange)
|
||||||
|
|
@ -1010,6 +1017,7 @@ proc genNewSeq(p: BProc, e: PNode) =
|
||||||
initLocExpr(p, e.sons[1], a)
|
initLocExpr(p, e.sons[1], a)
|
||||||
initLocExpr(p, e.sons[2], b)
|
initLocExpr(p, e.sons[2], b)
|
||||||
genNewSeqAux(p, a, b.rdLoc)
|
genNewSeqAux(p, a, b.rdLoc)
|
||||||
|
gcUsage(e)
|
||||||
|
|
||||||
proc genObjConstr(p: BProc, e: PNode, d: var TLoc) =
|
proc genObjConstr(p: BProc, e: PNode, d: var TLoc) =
|
||||||
var tmp: TLoc
|
var tmp: TLoc
|
||||||
|
|
@ -1021,6 +1029,7 @@ proc genObjConstr(p: BProc, e: PNode, d: var TLoc) =
|
||||||
rawGenNew(p, tmp, nil)
|
rawGenNew(p, tmp, nil)
|
||||||
t = t.sons[0].skipTypes(abstractInst)
|
t = t.sons[0].skipTypes(abstractInst)
|
||||||
r = ropef("(*$1)", r)
|
r = ropef("(*$1)", r)
|
||||||
|
gcUsage(e)
|
||||||
discard getTypeDesc(p.module, t)
|
discard getTypeDesc(p.module, t)
|
||||||
for i in 1 .. <e.len:
|
for i in 1 .. <e.len:
|
||||||
let it = e.sons[i]
|
let it = e.sons[i]
|
||||||
|
|
@ -1059,6 +1068,7 @@ proc genSeqConstr(p: BProc, t: PNode, d: var TLoc) =
|
||||||
arr.r = rfmt(nil, "$1->data[$2]", rdLoc(d), intLiteral(i))
|
arr.r = rfmt(nil, "$1->data[$2]", rdLoc(d), intLiteral(i))
|
||||||
arr.s = OnHeap # we know that sequences are on the heap
|
arr.s = OnHeap # we know that sequences are on the heap
|
||||||
expr(p, t.sons[i], arr)
|
expr(p, t.sons[i], arr)
|
||||||
|
gcUsage(t)
|
||||||
|
|
||||||
proc genArrToSeq(p: BProc, t: PNode, d: var TLoc) =
|
proc genArrToSeq(p: BProc, t: PNode, d: var TLoc) =
|
||||||
var elem, a, arr: TLoc
|
var elem, a, arr: TLoc
|
||||||
|
|
@ -1099,6 +1109,7 @@ proc genNewFinalize(p: BProc, e: PNode) =
|
||||||
genAssignment(p, a, b, {needToKeepAlive}) # set the object type:
|
genAssignment(p, a, b, {needToKeepAlive}) # set the object type:
|
||||||
bt = skipTypes(refType.sons[0], abstractRange)
|
bt = skipTypes(refType.sons[0], abstractRange)
|
||||||
genObjectInit(p, cpsStmts, bt, a, false)
|
genObjectInit(p, cpsStmts, bt, a, false)
|
||||||
|
gcUsage(e)
|
||||||
|
|
||||||
proc genOf(p: BProc, x: PNode, typ: PType, d: var TLoc) =
|
proc genOf(p: BProc, x: PNode, typ: PType, d: var TLoc) =
|
||||||
var a: TLoc
|
var a: TLoc
|
||||||
|
|
@ -1176,6 +1187,7 @@ proc genRepr(p: BProc, e: PNode, d: var TLoc) =
|
||||||
else:
|
else:
|
||||||
putIntoDest(p, d, e.typ, ropecg(p.module, "#reprAny($1, $2)",
|
putIntoDest(p, d, e.typ, ropecg(p.module, "#reprAny($1, $2)",
|
||||||
[addrLoc(a), genTypeInfo(p.module, t)]))
|
[addrLoc(a), genTypeInfo(p.module, t)]))
|
||||||
|
gcUsage(e)
|
||||||
|
|
||||||
proc genGetTypeInfo(p: BProc, e: PNode, d: var TLoc) =
|
proc genGetTypeInfo(p: BProc, e: PNode, d: var TLoc) =
|
||||||
var t = skipTypes(e.sons[1].typ, abstractVarRange)
|
var t = skipTypes(e.sons[1].typ, abstractVarRange)
|
||||||
|
|
@ -1187,6 +1199,7 @@ proc genDollar(p: BProc, n: PNode, d: var TLoc, frmt: string) =
|
||||||
a.r = ropecg(p.module, frmt, [rdLoc(a)])
|
a.r = ropecg(p.module, frmt, [rdLoc(a)])
|
||||||
if d.k == locNone: getTemp(p, n.typ, d)
|
if d.k == locNone: getTemp(p, n.typ, d)
|
||||||
genAssignment(p, d, a, {needToKeepAlive})
|
genAssignment(p, d, a, {needToKeepAlive})
|
||||||
|
gcUsage(n)
|
||||||
|
|
||||||
proc genArrayLen(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
|
proc genArrayLen(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
|
||||||
var a = e.sons[1]
|
var a = e.sons[1]
|
||||||
|
|
@ -1227,10 +1240,12 @@ proc genSetLengthSeq(p: BProc, e: PNode, d: var TLoc) =
|
||||||
rdLoc(a), rdLoc(b), getTypeDesc(p.module, t),
|
rdLoc(a), rdLoc(b), getTypeDesc(p.module, t),
|
||||||
getTypeDesc(p.module, t.sons[0])])
|
getTypeDesc(p.module, t.sons[0])])
|
||||||
keepAlive(p, a)
|
keepAlive(p, a)
|
||||||
|
gcUsage(e)
|
||||||
|
|
||||||
proc genSetLengthStr(p: BProc, e: PNode, d: var TLoc) =
|
proc genSetLengthStr(p: BProc, e: PNode, d: var TLoc) =
|
||||||
binaryStmt(p, e, d, "$1 = #setLengthStr($1, $2);$n")
|
binaryStmt(p, e, d, "$1 = #setLengthStr($1, $2);$n")
|
||||||
keepAlive(p, d)
|
keepAlive(p, d)
|
||||||
|
gcUsage(e)
|
||||||
|
|
||||||
proc genSwap(p: BProc, e: PNode, d: var TLoc) =
|
proc genSwap(p: BProc, e: PNode, d: var TLoc) =
|
||||||
# swap(a, b) -->
|
# swap(a, b) -->
|
||||||
|
|
@ -1462,6 +1477,7 @@ proc convCStrToStr(p: BProc, n: PNode, d: var TLoc) =
|
||||||
initLocExpr(p, n.sons[0], a)
|
initLocExpr(p, n.sons[0], a)
|
||||||
putIntoDest(p, d, skipTypes(n.typ, abstractVar),
|
putIntoDest(p, d, skipTypes(n.typ, abstractVar),
|
||||||
ropecg(p.module, "#cstrToNimstr($1)", [rdLoc(a)]))
|
ropecg(p.module, "#cstrToNimstr($1)", [rdLoc(a)]))
|
||||||
|
gcUsage(n)
|
||||||
|
|
||||||
proc genStrEquals(p: BProc, e: PNode, d: var TLoc) =
|
proc genStrEquals(p: BProc, e: PNode, d: var TLoc) =
|
||||||
var x: TLoc
|
var x: TLoc
|
||||||
|
|
|
||||||
|
|
@ -953,7 +953,7 @@ proc genAsgn(c: PCtx; le, ri: PNode; requiresCopy: bool) =
|
||||||
c.gABx(le, whichAsgnOpc(le, opcWrGlobal), tmp, s.position)
|
c.gABx(le, whichAsgnOpc(le, opcWrGlobal), tmp, s.position)
|
||||||
else:
|
else:
|
||||||
internalAssert s.position > 0 or (s.position == 0 and
|
internalAssert s.position > 0 or (s.position == 0 and
|
||||||
s.kind in {skParam, skResult})
|
s.kind in {skParam,skResult,skForVar})
|
||||||
var dest: TRegister = s.position + ord(s.kind == skParam)
|
var dest: TRegister = s.position + ord(s.kind == skParam)
|
||||||
gen(c, ri, dest)
|
gen(c, ri, dest)
|
||||||
else:
|
else:
|
||||||
|
|
@ -1014,7 +1014,8 @@ proc genRdVar(c: PCtx; n: PNode; dest: var TDest) =
|
||||||
else:
|
else:
|
||||||
c.gABx(n, opcLdGlobal, dest, s.position)
|
c.gABx(n, opcLdGlobal, dest, s.position)
|
||||||
else:
|
else:
|
||||||
if s.position > 0 or (s.position == 0 and s.kind in {skParam, skResult}):
|
if s.position > 0 or (s.position == 0 and
|
||||||
|
s.kind in {skParam,skResult,skForVar}):
|
||||||
if dest < 0:
|
if dest < 0:
|
||||||
dest = s.position + ord(s.kind == skParam)
|
dest = s.position + ord(s.kind == skParam)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -114,10 +114,10 @@ when defined(boehmgc):
|
||||||
proc alloc0(size: int): pointer =
|
proc alloc0(size: int): pointer =
|
||||||
result = alloc(size)
|
result = alloc(size)
|
||||||
zeroMem(result, size)
|
zeroMem(result, size)
|
||||||
proc realloc(p: Pointer, newsize: int): pointer =
|
proc realloc(p: pointer, newsize: int): pointer =
|
||||||
result = boehmRealloc(p, newsize)
|
result = boehmRealloc(p, newsize)
|
||||||
if result == nil: raiseOutOfMem()
|
if result == nil: raiseOutOfMem()
|
||||||
proc dealloc(p: Pointer) = boehmDealloc(p)
|
proc dealloc(p: pointer) = boehmDealloc(p)
|
||||||
|
|
||||||
proc allocShared(size: int): pointer =
|
proc allocShared(size: int): pointer =
|
||||||
result = boehmAlloc(size)
|
result = boehmAlloc(size)
|
||||||
|
|
@ -125,26 +125,26 @@ when defined(boehmgc):
|
||||||
proc allocShared0(size: int): pointer =
|
proc allocShared0(size: int): pointer =
|
||||||
result = alloc(size)
|
result = alloc(size)
|
||||||
zeroMem(result, size)
|
zeroMem(result, size)
|
||||||
proc reallocShared(p: Pointer, newsize: int): pointer =
|
proc reallocShared(p: pointer, newsize: int): pointer =
|
||||||
result = boehmRealloc(p, newsize)
|
result = boehmRealloc(p, newsize)
|
||||||
if result == nil: raiseOutOfMem()
|
if result == nil: raiseOutOfMem()
|
||||||
proc deallocShared(p: Pointer) = boehmDealloc(p)
|
proc deallocShared(p: pointer) = boehmDealloc(p)
|
||||||
|
|
||||||
#boehmGCincremental()
|
#boehmGCincremental()
|
||||||
|
|
||||||
proc GC_disable() = boehmGC_disable()
|
proc GC_disable() = boehmGC_disable()
|
||||||
proc GC_enable() = boehmGC_enable()
|
proc GC_enable() = boehmGC_enable()
|
||||||
proc GC_fullCollect() = boehmGCfullCollect()
|
proc GC_fullCollect() = boehmGCfullCollect()
|
||||||
proc GC_setStrategy(strategy: TGC_Strategy) = nil
|
proc GC_setStrategy(strategy: TGC_Strategy) = discard
|
||||||
proc GC_enableMarkAndSweep() = nil
|
proc GC_enableMarkAndSweep() = discard
|
||||||
proc GC_disableMarkAndSweep() = nil
|
proc GC_disableMarkAndSweep() = discard
|
||||||
proc GC_getStatistics(): string = return ""
|
proc GC_getStatistics(): string = return ""
|
||||||
|
|
||||||
proc getOccupiedMem(): int = return boehmGetHeapSize()-boehmGetFreeBytes()
|
proc getOccupiedMem(): int = return boehmGetHeapSize()-boehmGetFreeBytes()
|
||||||
proc getFreeMem(): int = return boehmGetFreeBytes()
|
proc getFreeMem(): int = return boehmGetFreeBytes()
|
||||||
proc getTotalMem(): int = return boehmGetHeapSize()
|
proc getTotalMem(): int = return boehmGetHeapSize()
|
||||||
|
|
||||||
proc setStackBottom(theStackBottom: pointer) = nil
|
proc setStackBottom(theStackBottom: pointer) = discard
|
||||||
|
|
||||||
proc initGC() =
|
proc initGC() =
|
||||||
when defined(macosx): boehmGCinit()
|
when defined(macosx): boehmGCinit()
|
||||||
|
|
@ -160,8 +160,8 @@ when defined(boehmgc):
|
||||||
proc growObj(old: pointer, newsize: int): pointer =
|
proc growObj(old: pointer, newsize: int): pointer =
|
||||||
result = realloc(old, newsize)
|
result = realloc(old, newsize)
|
||||||
|
|
||||||
proc nimGCref(p: pointer) {.compilerproc, inline.} = nil
|
proc nimGCref(p: pointer) {.compilerproc, inline.} = discard
|
||||||
proc nimGCunref(p: pointer) {.compilerproc, inline.} = nil
|
proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard
|
||||||
|
|
||||||
proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
||||||
dest[] = src
|
dest[] = src
|
||||||
|
|
@ -173,15 +173,15 @@ when defined(boehmgc):
|
||||||
type
|
type
|
||||||
TMemRegion = object {.final, pure.}
|
TMemRegion = object {.final, pure.}
|
||||||
|
|
||||||
proc Alloc(r: var TMemRegion, size: int): pointer =
|
proc alloc(r: var TMemRegion, size: int): pointer =
|
||||||
result = boehmAlloc(size)
|
result = boehmAlloc(size)
|
||||||
if result == nil: raiseOutOfMem()
|
if result == nil: raiseOutOfMem()
|
||||||
proc Alloc0(r: var TMemRegion, size: int): pointer =
|
proc alloc0(r: var TMemRegion, size: int): pointer =
|
||||||
result = alloc(size)
|
result = alloc(size)
|
||||||
zeroMem(result, size)
|
zeroMem(result, size)
|
||||||
proc Dealloc(r: var TMemRegion, p: Pointer) = boehmDealloc(p)
|
proc dealloc(r: var TMemRegion, p: Pointer) = boehmDealloc(p)
|
||||||
proc deallocOsPages(r: var TMemRegion) {.inline.} = nil
|
proc deallocOsPages(r: var TMemRegion) {.inline.} = discard
|
||||||
proc deallocOsPages() {.inline.} = nil
|
proc deallocOsPages() {.inline.} = discard
|
||||||
|
|
||||||
include "system/cellsets"
|
include "system/cellsets"
|
||||||
elif defined(nogc) and defined(useMalloc):
|
elif defined(nogc) and defined(useMalloc):
|
||||||
|
|
@ -193,10 +193,10 @@ elif defined(nogc) and defined(useMalloc):
|
||||||
proc alloc0(size: int): pointer =
|
proc alloc0(size: int): pointer =
|
||||||
result = alloc(size)
|
result = alloc(size)
|
||||||
zeroMem(result, size)
|
zeroMem(result, size)
|
||||||
proc realloc(p: Pointer, newsize: int): pointer =
|
proc realloc(p: pointer, newsize: int): pointer =
|
||||||
result = crealloc(p, newsize)
|
result = crealloc(p, newsize)
|
||||||
if result == nil: raiseOutOfMem()
|
if result == nil: raiseOutOfMem()
|
||||||
proc dealloc(p: Pointer) = cfree(p)
|
proc dealloc(p: pointer) = cfree(p)
|
||||||
|
|
||||||
proc allocShared(size: int): pointer =
|
proc allocShared(size: int): pointer =
|
||||||
result = cmalloc(size)
|
result = cmalloc(size)
|
||||||
|
|
@ -204,26 +204,26 @@ elif defined(nogc) and defined(useMalloc):
|
||||||
proc allocShared0(size: int): pointer =
|
proc allocShared0(size: int): pointer =
|
||||||
result = alloc(size)
|
result = alloc(size)
|
||||||
zeroMem(result, size)
|
zeroMem(result, size)
|
||||||
proc reallocShared(p: Pointer, newsize: int): pointer =
|
proc reallocShared(p: pointer, newsize: int): pointer =
|
||||||
result = crealloc(p, newsize)
|
result = crealloc(p, newsize)
|
||||||
if result == nil: raiseOutOfMem()
|
if result == nil: raiseOutOfMem()
|
||||||
proc deallocShared(p: Pointer) = cfree(p)
|
proc deallocShared(p: pointer) = cfree(p)
|
||||||
|
|
||||||
proc GC_disable() = nil
|
proc GC_disable() = discard
|
||||||
proc GC_enable() = nil
|
proc GC_enable() = discard
|
||||||
proc GC_fullCollect() = nil
|
proc GC_fullCollect() = discard
|
||||||
proc GC_setStrategy(strategy: TGC_Strategy) = nil
|
proc GC_setStrategy(strategy: TGC_Strategy) = discard
|
||||||
proc GC_enableMarkAndSweep() = nil
|
proc GC_enableMarkAndSweep() = discard
|
||||||
proc GC_disableMarkAndSweep() = nil
|
proc GC_disableMarkAndSweep() = discard
|
||||||
proc GC_getStatistics(): string = return ""
|
proc GC_getStatistics(): string = return ""
|
||||||
|
|
||||||
proc getOccupiedMem(): int = nil
|
proc getOccupiedMem(): int = discard
|
||||||
proc getFreeMem(): int = nil
|
proc getFreeMem(): int = discard
|
||||||
proc getTotalMem(): int = nil
|
proc getTotalMem(): int = discard
|
||||||
|
|
||||||
proc setStackBottom(theStackBottom: pointer) = nil
|
proc setStackBottom(theStackBottom: pointer) = discard
|
||||||
|
|
||||||
proc initGC() = nil
|
proc initGC() = discard
|
||||||
|
|
||||||
proc newObj(typ: PNimType, size: int): pointer {.compilerproc.} =
|
proc newObj(typ: PNimType, size: int): pointer {.compilerproc.} =
|
||||||
result = alloc(size)
|
result = alloc(size)
|
||||||
|
|
@ -235,8 +235,8 @@ elif defined(nogc) and defined(useMalloc):
|
||||||
proc growObj(old: pointer, newsize: int): pointer =
|
proc growObj(old: pointer, newsize: int): pointer =
|
||||||
result = realloc(old, newsize)
|
result = realloc(old, newsize)
|
||||||
|
|
||||||
proc nimGCref(p: pointer) {.compilerproc, inline.} = nil
|
proc nimGCref(p: pointer) {.compilerproc, inline.} = discard
|
||||||
proc nimGCunref(p: pointer) {.compilerproc, inline.} = nil
|
proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard
|
||||||
|
|
||||||
proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
||||||
dest[] = src
|
dest[] = src
|
||||||
|
|
@ -248,13 +248,13 @@ elif defined(nogc) and defined(useMalloc):
|
||||||
type
|
type
|
||||||
TMemRegion = object {.final, pure.}
|
TMemRegion = object {.final, pure.}
|
||||||
|
|
||||||
proc Alloc(r: var TMemRegion, size: int): pointer =
|
proc alloc(r: var TMemRegion, size: int): pointer =
|
||||||
result = alloc(size)
|
result = alloc(size)
|
||||||
proc Alloc0(r: var TMemRegion, size: int): pointer =
|
proc alloc0(r: var TMemRegion, size: int): pointer =
|
||||||
result = alloc0(size)
|
result = alloc0(size)
|
||||||
proc Dealloc(r: var TMemRegion, p: Pointer) = Dealloc(p)
|
proc dealloc(r: var TMemRegion, p: pointer) = dealloc(p)
|
||||||
proc deallocOsPages(r: var TMemRegion) {.inline.} = nil
|
proc deallocOsPages(r: var TMemRegion) {.inline.} = discard
|
||||||
proc deallocOsPages() {.inline.} = nil
|
proc deallocOsPages() {.inline.} = discard
|
||||||
|
|
||||||
elif defined(nogc):
|
elif defined(nogc):
|
||||||
# Even though we don't want the GC, we cannot simply use C's memory manager
|
# Even though we don't want the GC, we cannot simply use C's memory manager
|
||||||
|
|
@ -268,13 +268,13 @@ elif defined(nogc):
|
||||||
|
|
||||||
include "system/alloc"
|
include "system/alloc"
|
||||||
|
|
||||||
proc initGC() = nil
|
proc initGC() = discard
|
||||||
proc GC_disable() = nil
|
proc GC_disable() = discard
|
||||||
proc GC_enable() = nil
|
proc GC_enable() = discard
|
||||||
proc GC_fullCollect() = nil
|
proc GC_fullCollect() = discard
|
||||||
proc GC_setStrategy(strategy: TGC_Strategy) = nil
|
proc GC_setStrategy(strategy: TGC_Strategy) = discard
|
||||||
proc GC_enableMarkAndSweep() = nil
|
proc GC_enableMarkAndSweep() = discard
|
||||||
proc GC_disableMarkAndSweep() = nil
|
proc GC_disableMarkAndSweep() = discard
|
||||||
proc GC_getStatistics(): string = return ""
|
proc GC_getStatistics(): string = return ""
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -287,9 +287,9 @@ elif defined(nogc):
|
||||||
proc growObj(old: pointer, newsize: int): pointer =
|
proc growObj(old: pointer, newsize: int): pointer =
|
||||||
result = realloc(old, newsize)
|
result = realloc(old, newsize)
|
||||||
|
|
||||||
proc setStackBottom(theStackBottom: pointer) = nil
|
proc setStackBottom(theStackBottom: pointer) = discard
|
||||||
proc nimGCref(p: pointer) {.compilerproc, inline.} = nil
|
proc nimGCref(p: pointer) {.compilerproc, inline.} = discard
|
||||||
proc nimGCunref(p: pointer) {.compilerproc, inline.} = nil
|
proc nimGCunref(p: pointer) {.compilerproc, inline.} = discard
|
||||||
|
|
||||||
proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerproc, inline.} =
|
||||||
dest[] = src
|
dest[] = src
|
||||||
|
|
|
||||||
1
todo.txt
1
todo.txt
|
|
@ -3,7 +3,6 @@ version 0.9.4
|
||||||
|
|
||||||
- test&finish first class iterators:
|
- test&finish first class iterators:
|
||||||
* nested iterators
|
* nested iterators
|
||||||
- ``--gc:none`` should complain about when you use the GC
|
|
||||||
- ensure (ref T)(a, b) works as a type conversion and type constructor
|
- ensure (ref T)(a, b) works as a type conversion and type constructor
|
||||||
- document new templating symbol binding rules
|
- document new templating symbol binding rules
|
||||||
- make '--implicitStatic:on' the default
|
- make '--implicitStatic:on' the default
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ Changes affecting backwards compatibility
|
||||||
- ``macros.dumpTree`` and ``macros.dumpLisp`` have been made ``immediate``,
|
- ``macros.dumpTree`` and ``macros.dumpLisp`` have been made ``immediate``,
|
||||||
``dumpTreeImm`` and ``dumpLispImm`` are now deprecated.
|
``dumpTreeImm`` and ``dumpLispImm`` are now deprecated.
|
||||||
- The ``nil`` statement has been deprecated, use an empty ``discard`` instead.
|
- The ``nil`` statement has been deprecated, use an empty ``discard`` instead.
|
||||||
|
- ``sockets.select`` now prunes sockets that are **not** ready from the list
|
||||||
|
of sockets given to it.
|
||||||
|
|
||||||
|
|
||||||
Compiler Additions
|
Compiler Additions
|
||||||
|
|
@ -54,6 +56,7 @@ Compiler Additions
|
||||||
- The old evaluation engine has been replaced by a proper register based
|
- The old evaluation engine has been replaced by a proper register based
|
||||||
virtual machine. This fixes numerous bugs for ``nimrod i`` and for macro
|
virtual machine. This fixes numerous bugs for ``nimrod i`` and for macro
|
||||||
evaluation.
|
evaluation.
|
||||||
|
- ``--gc:none`` produces warnings when code uses the GC.
|
||||||
|
|
||||||
|
|
||||||
Language Additions
|
Language Additions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue