703 lines
23 KiB
HTML
703 lines
23 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Struct UnsafeStack<T> | Misaki.HighPerformance </title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="title" content="Struct UnsafeStack<T> | Misaki.HighPerformance ">
|
|
|
|
<meta name="description" content="Provides a high-performance, unsafe stack data structure for unmanaged types, supporting manual memory management and allocation control.">
|
|
<link rel="icon" href="../favicon.ico">
|
|
<link rel="stylesheet" href="../public/docfx.min.css">
|
|
<link rel="stylesheet" href="../public/main.css">
|
|
<meta name="docfx:navrel" content="../toc.html">
|
|
<meta name="docfx:tocrel" content="toc.html">
|
|
|
|
<meta name="docfx:rel" content="../">
|
|
|
|
|
|
|
|
<meta name="loc:inThisArticle" content="In this article">
|
|
<meta name="loc:searchResultsCount" content="{count} results for "{query}"">
|
|
<meta name="loc:searchNoResults" content="No results for "{query}"">
|
|
<meta name="loc:tocFilter" content="Filter by title">
|
|
<meta name="loc:nextArticle" content="Next">
|
|
<meta name="loc:prevArticle" content="Previous">
|
|
<meta name="loc:themeLight" content="Light">
|
|
<meta name="loc:themeDark" content="Dark">
|
|
<meta name="loc:themeAuto" content="Auto">
|
|
<meta name="loc:changeTheme" content="Change theme">
|
|
<meta name="loc:copy" content="Copy">
|
|
<meta name="loc:downloadPdf" content="Download PDF">
|
|
|
|
<script type="module" src="./../public/docfx.min.js"></script>
|
|
|
|
<script>
|
|
const theme = localStorage.getItem('theme') || 'auto'
|
|
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
|
|
<header class="bg-body border-bottom">
|
|
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
|
|
<div class="container-xxl flex-nowrap">
|
|
<a class="navbar-brand" href="../index.html">
|
|
<img id="logo" class="svg" src="../logo.svg" alt="Misaki.HighPerformance">
|
|
Misaki.HighPerformance
|
|
</a>
|
|
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
|
|
<i class="bi bi-three-dots"></i>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navpanel">
|
|
<div id="navbar">
|
|
<form class="search" role="search" id="search">
|
|
<i class="bi bi-search"></i>
|
|
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="container-xxl">
|
|
<div class="toc-offcanvas">
|
|
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
|
|
<div class="offcanvas-header">
|
|
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
|
|
</div>
|
|
<div class="offcanvas-body">
|
|
<nav class="toc" id="toc"></nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="content">
|
|
<div class="actionbar">
|
|
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
|
|
<i class="bi bi-list"></i>
|
|
</button>
|
|
|
|
<nav id="breadcrumb"></nav>
|
|
</div>
|
|
|
|
<article data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1">
|
|
|
|
|
|
|
|
<h1 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1" class="text-break">
|
|
Struct UnsafeStack<T>
|
|
</h1>
|
|
|
|
<div class="facts text-secondary">
|
|
<dl><dt>Namespace</dt><dd><a class="xref" href="Misaki.html">Misaki</a>.<a class="xref" href="Misaki.HighPerformance.html">HighPerformance</a>.<a class="xref" href="Misaki.HighPerformance.LowLevel.html">LowLevel</a>.<a class="xref" href="Misaki.HighPerformance.LowLevel.Collections.html">Collections</a></dd></dl>
|
|
<dl><dt>Assembly</dt><dd>Misaki.HighPerformance.LowLevel.dll</dd></dl>
|
|
</div>
|
|
|
|
<div class="markdown summary"><p>Provides a high-performance, unsafe stack data structure for unmanaged types, supporting manual memory management
|
|
and allocation control.</p>
|
|
</div>
|
|
<div class="markdown conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public struct UnsafeStack<T> : IUnsafeCollection<T>, IUnsafeCollection, IDisposable where T : unmanaged</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The type of elements stored in the stack. Must be an unmanaged type.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
<dl class="typelist implements">
|
|
<dt>Implements</dt>
|
|
<dd>
|
|
<div><a class="xref" href="Misaki.HighPerformance.LowLevel.Collections.Contracts.IUnsafeCollection-1.html">IUnsafeCollection</a><T></div>
|
|
<div><a class="xref" href="Misaki.HighPerformance.LowLevel.Collections.Contracts.IUnsafeCollection.html">IUnsafeCollection</a></div>
|
|
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
<dl class="typelist inheritedMembers">
|
|
<dt>Inherited Members</dt>
|
|
<dd>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetype.equals">ValueType.Equals(object)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetype.gethashcode">ValueType.GetHashCode()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.valuetype.tostring">ValueType.ToString()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="section" id="constructors">Constructors
|
|
</h2>
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1__ctor_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.#ctor*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1__ctor" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.#ctor">
|
|
UnsafeStack()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Initializes a new instance of UnsafeStack with a default size of 1 and a persistent allocation handle.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public UnsafeStack()</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1__ctor_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.#ctor*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1__ctor_System_Int32_Misaki_HighPerformance_LowLevel_Buffer_AllocationHandle_Misaki_HighPerformance_LowLevel_Buffer_AllocationOption_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.#ctor(System.Int32,Misaki.HighPerformance.LowLevel.Buffer.AllocationHandle,Misaki.HighPerformance.LowLevel.Buffer.AllocationOption)">
|
|
UnsafeStack(int, AllocationHandle, AllocationOption)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Initializes a new instance of the UnsafeStack class with the specified initial capacity and allocation options.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public UnsafeStack(int capacity, AllocationHandle handle, AllocationOption allocationOption = AllocationOption.None)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>capacity</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>The number of elements the stack can initially hold. Must be greater than zero.</p>
|
|
</dd>
|
|
<dt><code>handle</code> <a class="xref" href="Misaki.HighPerformance.LowLevel.Buffer.AllocationHandle.html">AllocationHandle</a></dt>
|
|
<dd><p>A reference to an AllocationHandle used to manage the underlying memory allocation for the stack.</p>
|
|
</dd>
|
|
<dt><code>allocationOption</code> <a class="xref" href="Misaki.HighPerformance.LowLevel.Buffer.AllocationOption.html">AllocationOption</a></dt>
|
|
<dd><p>Specifies additional options for memory allocation. The default is AllocationOption.None.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="section" id="properties">Properties
|
|
</h2>
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Capacity_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Capacity*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Capacity" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Capacity">
|
|
Capacity
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly int Capacity { get; }</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Property Value</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Count_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Count*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Count" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Count">
|
|
Count
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Gets the number of elements in a collection.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly int Count { get; }</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Property Value</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_IsCreated_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.IsCreated*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_IsCreated" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.IsCreated">
|
|
IsCreated
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Indicates whether the object has been created. Returns true if the object is created, otherwise false.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly bool IsCreated { get; }</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Property Value</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
<h4 class="section" id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_IsCreated_remarks">Remarks</h4>
|
|
<div class="markdown level1 remarks"><p>If MHP_ENABLE_STACKTRACE is not defined, this property will only check if the underlying pointer is not null, which may not be sufficient to determine if the collection is fully initialized and ready for use.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<h2 class="section" id="methods">Methods
|
|
</h2>
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Clear_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Clear*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Clear" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Clear">
|
|
Clear()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Removes all elements from the collection. The collection will be empty after this operation.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void Clear()</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Dispose_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Dispose*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Dispose" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Dispose">
|
|
Dispose()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_GetEnumerator_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.GetEnumerator*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_GetEnumerator" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.GetEnumerator">
|
|
GetEnumerator()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">[UnscopedRef]
|
|
public UnsafeStack<T>.Enumerator GetEnumerator()</code></pre>
|
|
</div>
|
|
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack-1.html">UnsafeStack</a><T>.<a class="xref" href="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack-1.Enumerator.html">Enumerator</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_GetUnsafePtr_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.GetUnsafePtr*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_GetUnsafePtr" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.GetUnsafePtr">
|
|
GetUnsafePtr()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Returns a pointer to an unmanaged memory location. This pointer can be used for low-level memory operations.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly void* GetUnsafePtr()</code></pre>
|
|
</div>
|
|
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.void">void</a>*</dt>
|
|
<dd><p>The method returns a void pointer to the unsafe memory location.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Peek_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Peek*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Peek" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Peek">
|
|
Peek()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Returns the item at the top of the stack without removing it.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly T Peek()</code></pre>
|
|
</div>
|
|
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd><p>The item of type <code class="typeparamref">T</code> at the top of the stack.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Exceptions</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></dt>
|
|
<dd><p>Thrown when the stack is empty.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Pop_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Pop*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Pop" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Pop">
|
|
Pop()
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Removes and returns the object at the top of the stack.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public T Pop()</code></pre>
|
|
</div>
|
|
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd><p>The object removed from the top of the stack.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Exceptions</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></dt>
|
|
<dd><p>Thrown when the stack is empty.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Push_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Push*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Push__0__" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Push(`0@)">
|
|
Push(scoped in T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Adds an element to the top of the stack.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void Push(scoped in T value)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>value</code> <span class="xref">T</span></dt>
|
|
<dd><p>The element to add to the stack.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Resize_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Resize*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_Resize_System_Int32_Misaki_HighPerformance_LowLevel_Buffer_AllocationOption_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.Resize(System.Int32,Misaki.HighPerformance.LowLevel.Buffer.AllocationOption)">
|
|
Resize(int, AllocationOption)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Changes the size of a collection to the specified value.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public void Resize(int newSize, AllocationOption option = AllocationOption.None)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>newSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>Specifies the new size to which the collection should be adjusted.</p>
|
|
</dd>
|
|
<dt><code>option</code> <a class="xref" href="Misaki.HighPerformance.LowLevel.Buffer.AllocationOption.html">AllocationOption</a></dt>
|
|
<dd><p>Specifies allocation options that may affect how memory is managed during the resize operation.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_TryPeek_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.TryPeek*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_TryPeek__0__" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.TryPeek(`0@)">
|
|
TryPeek(out T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Attempts to return the item at the top of the stack without removing it.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public readonly bool TryPeek(out T value)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>value</code> <span class="xref">T</span></dt>
|
|
<dd><p>When this method returns, contains the item at the top of the stack if the stack is not empty; otherwise, the default value of <code class="typeparamref">T</code>.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd><p><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> if an item was successfully returned; otherwise, <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_TryPop_" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.TryPop*"></a>
|
|
|
|
<h3 id="Misaki_HighPerformance_LowLevel_Collections_UnsafeStack_1_TryPop__0__" data-uid="Misaki.HighPerformance.LowLevel.Collections.UnsafeStack`1.TryPop(`0@)">
|
|
TryPop(out T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Attempts to remove and return the object at the top of the stack.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public bool TryPop(out T value)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>value</code> <span class="xref">T</span></dt>
|
|
<dd><p>When this method returns, contains the object removed from the top of the stack, if the operation succeeded;
|
|
otherwise, the default value of <code class="typeparamref">T</code>.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd><p>true if an object was successfully removed and returned from the stack; otherwise, false.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</article>
|
|
|
|
<div class="contribution d-print-none">
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="affix">
|
|
<nav id="affix"></nav>
|
|
</div>
|
|
</main>
|
|
|
|
<div class="container-xxl search-results" id="search-results"></div>
|
|
|
|
<footer class="border-top text-secondary">
|
|
<div class="container-xxl">
|
|
<div class="flex-fill">
|
|
<span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|