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; }
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; }
public static unsafe void StructureToPtr <T>(ref T structure, IntPtr pointer) where T : struct { FastStructure <T> .StructureToPtr(ref structure, pointer); }