private object ConvertCSArrayToDSArray(double[] csArray, ProtoCore.DSASM.Interpreter dsi) { var core = dsi.runtime.Core; object retVal = null; lock (core.Heap.cslock) { var numElems = csArray.Length; int ptr = core.Heap.Allocate(numElems); for (int n = numElems - 1; n >= 0; --n) { core.Heap.Heaplist[ptr].Stack[n] = StackUtils.BuildDouble(csArray[n]); } retVal = StackUtils.BuildArrayPointer(ptr); //dsi.runtime.rmem.Push(StackUtils.BuildArrayPointer(ptr)); } return(retVal); }
public override StackValue Marshal(object obj, ProtoCore.Runtime.Context context, Interpreter dsi, ProtoCore.Type type) { return(StackUtils.BuildDouble(System.Convert.ToDouble(obj))); }