mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-03-21 05:51:07 +00:00
gpu allocation optimizations (ryubing/ryujinx!195)
See merge request ryubing/ryujinx!195
This commit is contained in:
@@ -7,11 +7,11 @@ namespace Ryujinx.Common
|
||||
where T : class
|
||||
{
|
||||
private int _size = size;
|
||||
private readonly ConcurrentStack<T> _items = new();
|
||||
private readonly ConcurrentBag<T> _items = new();
|
||||
|
||||
public T Allocate()
|
||||
{
|
||||
bool success = _items.TryPop(out T instance);
|
||||
bool success = _items.TryTake(out T instance);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
@@ -25,7 +25,7 @@ namespace Ryujinx.Common
|
||||
{
|
||||
if (_size < 0 || _items.Count < _size)
|
||||
{
|
||||
_items.Push(obj);
|
||||
_items.Add(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user