mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
31 lines
819 B
C#
31 lines
819 B
C#
using System.Runtime.InteropServices;
|
|
|
|
namespace Cosmos.Core
|
|
{
|
|
// The DataLookupTable (DLT) basically is a linked list.
|
|
internal unsafe struct DataLookupTable
|
|
{
|
|
public const int EntriesPerTable = 169;
|
|
|
|
public DataLookupTable* Previous;
|
|
public DataLookupTable* Next;
|
|
|
|
public DataLookupEntry FirstEntry;
|
|
|
|
public unsafe DataLookupEntry* GetEntry(int index)
|
|
{
|
|
fixed (DataLookupEntry* xFirstEntryPtr = &FirstEntry)
|
|
{
|
|
return &xFirstEntryPtr[index];
|
|
}
|
|
}
|
|
|
|
public void* GetFirstByteAfterTable()
|
|
{
|
|
fixed (DataLookupTable* xThisPtr = &this)
|
|
{
|
|
return (void*)(uint)(xThisPtr + GlobalSystemInfo.TotalDataLookupTableSize);
|
|
}
|
|
}
|
|
}
|
|
}
|