Quantum 3 3.1.0

Classes | Public Member Functions | Static Public Member Functions | List of all members
Quantum.MemoryLayoutVerifier Class Reference

Verifies the memory layout of types and detects any potential issues. More...

Classes

interface  IPlatform
 Represents a platform that can resolve the memory layout of types and detect any potential issues. More...
 

Public Member Functions

 MemoryLayoutVerifier ()
 Creates a new instance of the MemoryLayoutVerifier class. More...
 
 MemoryLayoutVerifier (IPlatform platform)
 Creates a new instance of the MemoryLayoutVerifier class. More...
 

Static Public Member Functions

static int GetFieldOffset (FieldInfo field)
 Returns the offset of a field in memory. More...
 
static ? int GetFieldOverlap (FieldInfo field)
 Gets the overlap offset of a field. More...
 
static bool IsFixedBuffer (FieldInfo field)
 Checks if a field is a fixed buffer. More...
 

Detailed Description

Verifies the memory layout of types and detects any potential issues.

Constructor & Destructor Documentation

◆ MemoryLayoutVerifier() [1/2]

Quantum.MemoryLayoutVerifier.MemoryLayoutVerifier ( IPlatform  platform)
inline

Creates a new instance of the MemoryLayoutVerifier class.

◆ MemoryLayoutVerifier() [2/2]

Quantum.MemoryLayoutVerifier.MemoryLayoutVerifier ( )
inline

Creates a new instance of the MemoryLayoutVerifier class.

Member Function Documentation

◆ IsFixedBuffer()

static bool Quantum.MemoryLayoutVerifier.IsFixedBuffer ( FieldInfo  field)
inlinestatic

Checks if a field is a fixed buffer.

Parameters
fieldThe field to inspect.
Returns
true if the field is a fixed buffer; false otherwise

◆ GetFieldOffset()

static int Quantum.MemoryLayoutVerifier.GetFieldOffset ( FieldInfo  field)
inlinestatic

Returns the offset of a field in memory.

Parameters
fieldThe field for which to retrieve the offset.
Returns
The offset of the field in memory.
Exceptions
ExceptionThrown if the field does not have the [FieldOffset] attribute.

◆ GetFieldOverlap()

static ? int Quantum.MemoryLayoutVerifier.GetFieldOverlap ( FieldInfo  field)
inlinestatic

Gets the overlap offset of a field.

Parameters
fieldThe field for which to get the overlap offset.
Returns
The overlap offset of the field, or null if no overlap is specified.