[Mono-dev] Could String constructors be redirected to managed methods?

Kornél Pál kornelpal at gmail.com
Mon Jul 10 11:51:55 EDT 2006


Hi,

The following methods are currently implemented using unmanaged code:
unsafe public extern String (sbyte *value);
unsafe public extern String (sbyte *value, int startIndex, int length);
unsafe public extern String (sbyte *value, int startIndex, int length, 
Encoding enc);

They all should use Encoding classes (overloads without encoding parameters 
should use Encoding.Default). I think they could be implemented more easily 
and probably much faster using managed code.

I attached a patch draft that contains CreateString methods that should be 
called instead of unmanaged code to show an example why this could be easier 
and faster.

Is it possible to redirect these constructors to CreateString methods 
instead of unmanaged functions? If possible how could this be implemented?

Thanks for your help.

Kornél 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: String.diff
Type: application/octet-stream
Size: 1712 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060710/1fe9e4ad/attachment.obj 


More information about the Mono-devel-list mailing list