Example #1
0
        static unsafe string Ctor(char *ptr, int index, int length)
        {
            var et = EETypePtr.EETypePtrOf <string>();

            var start = ptr + index;
            var data  = StartupCodeHelpers.RhpNewArray(et.Value, length);
            var s     = Unsafe.As <object, string>(ref data);

            fixed(char *c = &s._firstChar)
            {
                Platform.CopyMemory((IntPtr)c, (IntPtr)start, (ulong)length * sizeof(char));
                c[length] = '\0';
            }

            return(s);
        }