Table of Contents

Class SymbolStringPoolEntry

Namespace
Ubiquity.NET.Llvm.OrcJITv2
Assembly
Ubiquity.NET.Llvm.dll

Reference to an entry in a symbol string pool for ORC JIT v2

public sealed class SymbolStringPoolEntry : IEquatable<SymbolStringPoolEntry>, IDisposable
Inheritance
SymbolStringPoolEntry
Implements
Inherited Members

Remarks

This holds a reference to the symbol string which is ONLY marshaled/converted to a managed string in the ToString() method. This allows comparing strings etc... without the need of conversion.

information

String conversion is lazy, so that once it is converted the managed string is cached and used as needed. Thus, the overhead of marshalling the string is realized only the first time it is needed.

important

The ref count nature of an Entry is NOT consistent across LLVM APIs and requires the caller to know the behavior of the API with respect to the ref count:

  1. Simple Reference. [Temporary] ownership remains with the caller
  2. API takes ownership. [Move] ownership is transferred to native implementation
  3. API performs an addref. [Native 'Clone'] ownership of original Entry remains with caller
This can make use very problematic. To simplify this and keep things consistent, the implementation of the wrappers handles the special case of "Move" semantics, effectively converting it to a "Native Clone" scenario. Thus, the caller owns the ref count of any entries and the odd and inconsistent use of "move" semantics is handled internally so callers need not deal with that case directly.

Properties

Name

Gets the name of this symbol

ReadOnlySpan

Gets a readonly span for the data in this string

Methods

AddRef()

Adds a reference count for the symbol resulting in a distinct managed instance with it's own ref count (released via Dispose())

Dispose()

Release the reference to the string

Equals(object?)

Determines whether the specified object is equal to the current object.

Equals(ReadOnlySpan<byte>)

Tests if the span of characters for this string is identical to the provided span

Equals(SymbolStringPoolEntry?)

Compares this string with another to determine if they contain the same contents

GetHashCode()

Serves as the default hash function.

GetHashCode(StringComparison)

Gets the hash code for the managed string

ToString()

Gets the managed string form of the native string