The ezr² Project 0.1.1
The codebase for the ezr² programming language.
Loading...
Searching...
No Matches
EzrSquared.Runtime.ReferencePool Class Reference

A static pool for Reference. More...

Static Public Member Functions

static Reference Get (IEzrObject? @object=null, AccessMod accessibilityModifiers=AccessMod.None, string name="")
 Gets a freshly-reset reference from the pool or creates a new one.
 
static void TryRelease (Reference reference)
 Releases a reference to the pool.
 

Static Private Attributes

static readonly ConcurrentQueue< Reference > s_ezrObjectReferencePool = new()
 The pool of references.
 

Detailed Description

A static pool for Reference.

Member Function Documentation

◆ Get()

static Reference EzrSquared.Runtime.ReferencePool.Get ( IEzrObject? @ object = null,
AccessMod accessibilityModifiers = AccessMod::None,
string name = "" )
static

Gets a freshly-reset reference from the pool or creates a new one.

Parameters
objectThe IEzrObject being referenced.
accessibilityModifiersThe accessibility modifiers of the reference.
nameThe name of the reference.
Returns
The reference.

◆ TryRelease()

static void EzrSquared.Runtime.ReferencePool.TryRelease ( Reference reference)
static

Releases a reference to the pool.

Parameters
referenceThe reference to release.

The documentation for this class was generated from the following file: