Skip to content

PgNativeItemPointer

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Owns or borrows a native PostgreSQL ItemPointerData while copying its fields through selected-version headers.

public sealed class PgNativeItemPointer : IDisposable

Created values own one palloc allocation. Borrowed views never acquire release rights. Checked views share their owner’s invalidation; external raw pointers require an explicit lifetime anchor. Dispose owned values deterministically on the backend thread; no finalizer calls PostgreSQL.

Inheritance: object

Implements: IDisposable

Creates a borrowed view sharing the current owner’s invalidation without acquiring release rights.

public PgNativeItemPointer Borrow()

Returns: PgNativeItemPointer

The independently disposable borrowed view.

Copies both fields into independent, individually owned native storage.

public PgNativeItemPointer CloneInto(PgMemoryContext? context = null)

Parameters:

context — PgMemoryContext

The destination context, or null for the current context.

Returns: PgNativeItemPointer

The new owner.

Allocates a native item pointer in a selected context and copies both raw fields, including invalid values.

public static PgNativeItemPointer Create(PgItemPointer value, PgMemoryContext? context = null)

Parameters:

value — PgItemPointer

The initial location.

context — PgMemoryContext

The native owner, or null for the current memory context.

Returns: PgNativeItemPointer

The individually disposable owner.

Frees individually owned native storage or closes a borrowed view without freeing its referent.

public void Dispose()

Native free failures leave ownership intact for retry. Disposing storage already reclaimed by its context is harmless.

Gets the allocation owner or the external pointer’s explicit lifetime anchor after validating access.

public PgMemoryContext LifetimeContext { get; }

Value: PgMemoryContext

Gets or sets a copied location after checking the native allocation or external lifetime anchor.

public PgItemPointer Value { get; set; }

Value: PgItemPointer