lambda lifting support for iterToProc plugin
This commit is contained in:
parent
d7433d02bc
commit
217e0ab6e9
5 changed files with 88 additions and 18 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue