commit
c3959ea6c3
1 changed files with 7 additions and 0 deletions
|
|
@ -79,6 +79,7 @@ template withRegion*(r: MemRegion; body: untyped) =
|
||||||
try:
|
try:
|
||||||
body
|
body
|
||||||
finally:
|
finally:
|
||||||
|
r = tlRegion
|
||||||
tlRegion = oldRegion
|
tlRegion = oldRegion
|
||||||
|
|
||||||
template inc(p: pointer, s: int) =
|
template inc(p: pointer, s: int) =
|
||||||
|
|
@ -464,4 +465,10 @@ proc getFreeMem(): int = tlRegion.remaining
|
||||||
proc getTotalMem(): int =
|
proc getTotalMem(): int =
|
||||||
result = tlRegion.totalSize
|
result = tlRegion.totalSize
|
||||||
|
|
||||||
|
proc getOccupiedMem*(r: MemRegion): int =
|
||||||
|
result = r.totalSize - r.remaining
|
||||||
|
proc getFreeMem*(r: MemRegion): int = r.remaining
|
||||||
|
proc getTotalMem*(r: MemRegion): int =
|
||||||
|
result = r.totalSize
|
||||||
|
|
||||||
proc setStackBottom(theStackBottom: pointer) = discard
|
proc setStackBottom(theStackBottom: pointer) = discard
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue