Exemplo n.º 1
0
        internal static unsafe void PushFast <T>(ContextType *cxt, T arg)
            where T : struct
        {
            var size = FastStructure <T> .Size;

            var numArgs = (size / 8);

            if ((size % 8) != 0)
            {
                *(long *)(&cxt->functionData[8 * cxt->numArguments]) = 0;
                numArgs++;
            }

            FastStructure <T> .StructureToPtr(ref arg, new IntPtr(&cxt->functionData[8 * cxt->numArguments]));

            cxt->numArguments += numArgs;
        }
Exemplo n.º 2
0
        internal unsafe void PushFast <T>(T arg)
            where T : struct
        {
            var size = FastStructure <T> .Size;

            var numArgs = (size / 8);

            fixed(byte *functionData = m_context.functionData)
            {
                if ((size % 8) != 0)
                {
                    *(long *)(&functionData[8 * m_context.numArguments]) = 0;
                    numArgs++;
                }

                FastStructure <T> .StructureToPtr(ref arg, new IntPtr(&functionData[8 * m_context.numArguments]));
            }

            m_context.numArguments += numArgs;
        }
Exemplo n.º 3
0
 public static unsafe void StructureToPtr <T>(ref T structure, IntPtr pointer)
     where T : struct
 {
     FastStructure <T> .StructureToPtr(ref structure, pointer);
 }