Files
Performance-Fish/Source/PerformanceFish/Experimental/InlineArray256.cs
T
bbradson ca9321add8 Lots of new optimizations utilizing prepatcher
To start, this mod now requires Prepatcher and Fishery.
New optimizations include: gene ticking improvements, world object improvements, hediff optimizations, world pawn gc optimizations, better mothballing, dds support, ContentFinder caching, additions and changes to reflection caching, as well as various other additions. Multiplayer support has been improved too, but should be considered highly experimental. The WorkGiver_DoBill bug is fixed in this build. Multiple patches aiming to improve RimWorld's load time have been added too.
2023-06-03 20:24:38 +02:00

31 lines
835 B
C#

// Copyright (c) 2023 bradson
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
#if false
using System.Runtime.InteropServices;
namespace PerformanceFish.Experimental;
#pragma warning disable CS8500
/// <summary>
/// References within fixed size buffers don't get tracked by the GC. This leads to memory corruption. Don't use
/// </summary>
[StructLayout(LayoutKind.Explicit)]
public unsafe struct InlineArray256<T> where T : class
{
[FieldOffset(0)]
private T _firstEntry;
[FieldOffset(0)]
private fixed ulong _entries[256];
public T this[int index]
{
get => (&_firstEntry)[index];
set => (&_firstEntry)[index] = value;
}
}
#pragma warning restore CS8500
#endif