lambda lifting support for iterToProc plugin

This commit is contained in:
Araq 2015-11-29 15:00:19 +01:00
commit 217e0ab6e9
5 changed files with 88 additions and 18 deletions

View file

@ -40,7 +40,7 @@ when defined(emscripten):
MAP_PRIVATE = 2'i32 # Changes are private
var MAP_ANONYMOUS {.importc: "MAP_ANONYMOUS", header: "<sys/mman.h>".}: cint
type
type
PEmscriptenMMapBlock = ptr EmscriptenMMapBlock
EmscriptenMMapBlock {.pure, inheritable.} = object
realSize: int # size of previous chunk; for coalescing
@ -399,6 +399,9 @@ iterator allObjects(m: MemRegion): pointer {.inline.} =
let c = cast[PBigChunk](c)
yield addr(c.data)
proc iterToProc*(iter: typed, envType: typedesc; procName: untyped) {.
magic: "Plugin", compileTime.}
proc isCell(p: pointer): bool {.inline.} =
result = cast[ptr FreeCell](p).zeroField >% 1