[Mono-list] Fast Passing Strings to Interop without Marshaling

Chris Howie cdhowie at gmail.com
Mon Nov 3 13:49:38 EST 2008

On Mon, Nov 3, 2008 at 1:17 PM, Bradford Stephens
<bradfordstephens at gmail.com> wrote:
> The String is actually an XML document in memory, so byte-level
> manipulation isn't very useful. However, if we just used a byte* to
> get 'past the barrier', then re-converted it in C to a char* (where
> the code is faster), perhaps that would work?

If by convert to char* you mean cast to char* then no, it will not
work.  If you mean casting each element of what will be a short* to a
char* then yes it will work (assuming that all characters are ASCII)
but again you will be copying every character of that string
one-by-one, which is exactly what the marshaller does anyway.

Chris Howie

More information about the Mono-list mailing list