HLSf use nuint rather than long, L4 now uses hlsf rather than array to alloc cache line.
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
// -----------------------------------------------------------------------
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Hlsf = StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAllocator;
|
||||
|
||||
namespace StgSharp.HighPerformance.Memory
|
||||
{
|
||||
public partial class L4
|
||||
@@ -40,25 +42,33 @@ namespace StgSharp.HighPerformance.Memory
|
||||
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 16)]
|
||||
[StructLayout(LayoutKind.Explicit, Size = 64, Pack = 16)]
|
||||
private unsafe struct CacheLineHead
|
||||
{
|
||||
|
||||
internal nuint _address;
|
||||
internal nuint _origin;
|
||||
[FieldOffset(0)] internal Hlsf.Entry AllocatorEntry;
|
||||
|
||||
#region
|
||||
#region reference counting and state information
|
||||
|
||||
internal int _refCount;
|
||||
internal uint _size;
|
||||
[FieldOffset(52)] internal int RefCount;
|
||||
[FieldOffset(56)] internal int RemainingPredictionCount;
|
||||
[FieldOffset(60)] internal int Id;
|
||||
|
||||
#endregion
|
||||
|
||||
#region
|
||||
|
||||
internal int _id;
|
||||
internal short _predictor;
|
||||
internal ushort _profile;
|
||||
#region hlsf entry alias
|
||||
|
||||
[FieldOffset(24)] public readonly nuint Address;
|
||||
[FieldOffset(16)] public readonly uint Size;
|
||||
|
||||
#endregion
|
||||
|
||||
#region cache line information
|
||||
|
||||
[FieldOffset(50)] internal short Predictor;
|
||||
[FieldOffset(48)] internal ushort Profile;
|
||||
[FieldOffset(40)] internal nuint Origin;
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user