[Mono-dev] memcpy and memset (opcodes, C#, marshaling)

Kornél Pál kornelpal at gmail.com
Sun Mar 25 07:45:50 EDT 2007


Mono's String class has great managed memcpy and memset methods that 
internal. cpblk and initblk opcodes map to these two methods when cannot be 
easily inlined. But I know no way to make a C# compiler emit either cpblk or 
initblk using my own pointer parameters.

Is it somehow possible to use these opcodes in C# or should I copy these two 
methods to my own code?

System.Runtime.InteropServices.Marshal currently uses internal calls for 
methods I think are not doing any managed-to-unmanaged marshaling at all: 
Copy, Read... and Write... methods. Could these methods be implemented using 
enirely managed code (inline implemenation or a managed-to-managed)?


More information about the Mono-devel-list mailing list