[corlib] Add Mono.SafeStringMarshal struct
authorAleksey Kliger <aleksey@xamarin.com>
Tue, 19 Jul 2016 21:51:48 +0000 (17:51 -0400)
committerAleksey Kliger <aleksey@xamarin.com>
Fri, 29 Jul 2016 14:24:13 +0000 (10:24 -0400)
commit6fcec5e3cdda790975997924d58d875937a68ff0
treef786a6fdfad7bc0c14cb267e6b912a6e0c872f00
parentd5090f6c352d01c4fee7d789c42e6bb36a7a027e
[corlib] Add Mono.SafeStringMarshal struct

Allows safe allocation of native utf8 char* strings from managed
strings.

using (var h = new SafeStringMarshal (str)) {
   /* use h.Value IntPtr */
} // g_free'd by h.Dispose ()
mcs/class/corlib/Mono/SafeStringMarshal.cs [new file with mode: 0644]
mcs/class/corlib/corlib.dll.sources
mono/metadata/icall-def.h
mono/metadata/icall.c