It's possible that for some reason the Boehm GC is unable to access the
stack of your C# application. Try storing all your stack variables into
a structure that has been alloc_root'ed.
Hm, that might be.
OK, I've tried to use neko_alloc_root, like this:
NekoVM.neko_global_init(null);
void * vm = NekoVM.neko_vm_alloc(null);
NekoVM.neko_vm_select(vm);
NekoVM.value[] values = NekoVM.neko_alloc_root(100);
NekoVM.value loader = NekoVM.neko_default_loader(null, 0);
// Be sure to record value roots to avoid being garbage
collected
values[1] = loader;
where NekoVM.neko_alloc_root is declared like this:
[DllImport("c:\\flash\\neko\\bin\\neko.dll")]
public static extern value [] neko_alloc_root( uint nvals );
But when I run this, I get an exception at the neko_alloc_root call:
An unhandled exception of type '
System.Runtime.InteropServices.MarshalDirectiveException' occurred in
coach.net.exe
Additional information: Cannot marshal 'return value': Invalid
managed/unmanaged type combination.
I've tried various ways of declaring the neko_alloc_root method in C#, but I
have not managed to find a form which works. Any other ideas?
Regards,
Asger
Nicolas
--
Neko : One VM to run them all
(http://nekovm.org)
--
Neko : One VM to run them all
(http://nekovm.org)