Hi,
I think the problem might be that I'm marshalling Neko values as a simple
Enum, and thus the C# marshaller will not take the following values in
memory with it.
public enum val_type : uint {
VAL_INT = 0xFF,
VAL_NULL = 0,
VAL_FLOAT = 1,
VAL_BOOL = 2,
VAL_STRING = 3,
VAL_OBJECT = 4,
VAL_ARRAY = 5,
VAL_FUNCTION = 6,
VAL_ABSTRACT = 7,
VAL_PRIMITIVE = 6 | 8,
VAL_JITFUN = 6 | 16,
VAL_32_BITS = 0xFFFFFFFF
};
[StructLayout(LayoutKind.Sequential)]
public class value {
public val_type t;
};
The Neko value type is really a Union type, as far as I can see, and C# does
not support union types, AFAIK. So I'm at loss how to fix this. I guess I'll
have to read up on the native marshalling in C#.
Is there a way to find out how many bytes a value takes up?
Regards,
Asger
--
Neko : One VM to run them all
(http://nekovm.org)