ni: adds system to manage native local references to Nit objects
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 30 Mar 2012 19:55:36 +0000 (15:55 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 30 Mar 2012 19:55:36 +0000 (15:55 -0400)
commit9e62bdacc31a1d6fb68a8e4e3d2da7c9353efccd
tree8cfaeeb56b7ec68e553f76809f2c2a0788c0b8f1
parenta8c43a4db22cac3ed5b08b3be1e793dc083169d5
ni: adds system to manage native local references to Nit objects

This ensures that references to Nit objects from C within an extern
method are preserved when the GC is invoqued. Theses references
are registered automatically when any callback to the Nit system is
made. They are registered in a stack, local to the currently executing
extern method (ie the one on the top of the execution stack). All
registered references are cleared on the function return.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
clib/gc.c
clib/nit_common.h
clib/nit_main.c
src/compiling/compiling_icode.nit
src/native_interface/frontier.nit
src/native_interface/ni_metamodel.nit