mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
31 lines
849 B
C#
31 lines
849 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
|
|
namespace Indy.IL2CPU.CustomImplementation.System {
|
|
public static class StringImpl {
|
|
[MethodAlias(Name = "System.String System.String.FastAllocateString(System.Int32)")]
|
|
public static String FastAllocateString(int aLength) {
|
|
Char[] xItems = new Char[aLength];
|
|
return new String(xItems);
|
|
}
|
|
|
|
public static unsafe uint* GetStorageMetal(uint* aStringPtr) {
|
|
return aStringPtr + 1;
|
|
}
|
|
|
|
public static unsafe uint GetStorage(uint aStringPtr) {
|
|
return aStringPtr += 12;
|
|
}
|
|
|
|
public static unsafe uint* GetStorageNormal(uint* aStringPtr) {
|
|
uint* xResult = aStringPtr;
|
|
xResult = xResult + 3;
|
|
xResult = (uint*)(*xResult);
|
|
xResult += 3;
|
|
return xResult;
|
|
}
|
|
}
|
|
}
|