mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
[+] Books
[+] Books
This commit is contained in:
18
Books/3-3-内存池模块.md
Normal file
18
Books/3-3-内存池模块.md
Normal file
@@ -0,0 +1,18 @@
|
||||
## 3-3.内存池模块 - MemoryPool
|
||||
使用案例
|
||||
``` csharp
|
||||
/// <summary>
|
||||
/// 资源组数据。
|
||||
/// <remarks>DisposeGroup。</remarks>
|
||||
/// </summary>
|
||||
public class AssetGroup : IMemory
|
||||
{
|
||||
public void Clear(){}
|
||||
}
|
||||
|
||||
//内存池中获取/生成内存对象。
|
||||
AssetGroup assetGroup = MemoryPool.Acquire<AssetGroup>();
|
||||
|
||||
//释放内存对象还给内存池。
|
||||
MemoryPool.Release(assetGroup);
|
||||
```
|
Reference in New Issue
Block a user