time: Make TimeZoneRule blittable and avoid copies (#3361)

* time: Make TimeZoneRule blittable and avoid copies

This drastically reduce overhead of using TimeZoneRule around the
codebase.

Effect on games is unknown

* Add missing Box type

* Ensure we clean the structure still

This doesn't perform any copies

* Address gdkchan's comments

* Simplify Box
This commit is contained in:
Mary 2022-06-24 19:04:57 +02:00 committed by GitHub
parent 232b1012b0
commit 30ee70a9bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 157 additions and 147 deletions

View file

@ -128,7 +128,7 @@ namespace Ryujinx.HLE.Utilities
}
}
public static int CompareCStr(ReadOnlySpan<char> s1, ReadOnlySpan<char> s2)
public static int CompareCStr(ReadOnlySpan<byte> s1, ReadOnlySpan<byte> s2)
{
int s1Index = 0;
int s2Index = 0;
@ -142,11 +142,11 @@ namespace Ryujinx.HLE.Utilities
return s2[s2Index] - s1[s1Index];
}
public static int LengthCstr(ReadOnlySpan<char> s)
public static int LengthCstr(ReadOnlySpan<byte> s)
{
int i = 0;
while (s[i] != '\0')
while (s[i] != 0)
{
i++;
}