Beispiel #1
0
        public unsafe ExecutionResult *CreateExecutionResult(bool failed, type_primitive_id type, object value)
        {
            ExecutionResult *er = CreateExecutionResult(failed, type);

            er->ptr = MetacallDef.GetIntPtr(type, value);

            return(er);
        }
Beispiel #2
0
        public unsafe ExecutionResult *CreateExecutionResult(bool failed, type_primitive_id type)
        {
            ExecutionResult *er = (ExecutionResult *)Marshal.AllocHGlobal(sizeof(ExecutionResult));

            er->failed = failed;
            er->type   = type;
            er->ptr    = IntPtr.Zero;
            return(er);
        }
Beispiel #3
0
        public unsafe static void DestroyExecutionResult(ExecutionResult *executionResult)
        {
            if (executionResult->ptr != IntPtr.Zero)
            {
                Marshal.FreeHGlobal(executionResult->ptr);
            }

            Marshal.FreeHGlobal((IntPtr)executionResult);
        }