Skip to content

PgNativeReference<T>

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Borrows a copied unmanaged view without acquiring allocation or release rights.

public sealed class PgNativeReference<T> where T : unmanaged

Type parameters:

T

The complete unmanaged representation exposed by the view.

Checked allocation views observe resizing and share invalidation with their owner. Dangerous raw views use a context as a lifetime anchor; that context is not inferred to own the referenced bytes. The caller must still honor shorter external lifetimes such as stack return or resource closure.

Inheritance: object

Copies every representation byte, including padding and pointer fields, into independent context-owned storage.

public PgContextValue<T> CloneInto(PgMemoryContext? context = null)

Parameters:

context — PgMemoryContext

The destination context, or null for the current context.

Returns: PgContextValue<T>

A shallow context-owned copy with default allocation policies and alignment.

Copies every representation byte, including padding and pointer fields, into independent individually owned storage.

public PgNativeBox<T> CloneOwnedInto(PgMemoryContext? context = null)

Parameters:

context — PgMemoryContext

The destination context, or null for the current context.

Returns: PgNativeBox<T>

A shallow individually owned copy with default allocation policies and alignment.

Gets the checked allocation owner or the explicitly supplied raw-reference lifetime anchor.

public PgMemoryContext LifetimeContext { get; }

Value: PgMemoryContext

For a raw reference this is a lifetime anchor, not a claim about native allocator ownership.

Gets or sets a copied unmanaged value after checking its bounds and lifetime anchor.

public T Value { get; set; }

Value: T