mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 13:08:24 +01:00
83 lines
3.4 KiB
C#
83 lines
3.4 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Jolt.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
using System.Runtime.CompilerServices;
|
|
using Brutal.Interop;
|
|
using Brutal.Numerics;
|
|
|
|
namespace Brutal.JoltApi
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Allocator for a lock free hash map
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/LockFreeHashMap.h#L13">Jolt/Core/LockFreeHashMap.h:13</see>
|
|
/// <br/>
|
|
/// <c>class LFHMAllocator : public NonCopyable</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[InteropHandle]
|
|
public readonly partial struct LFHMAllocator : IDisposable
|
|
{
|
|
public static LFHMAllocator Create() => Jolt.PInvoke.LFHMAllocator_Create();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Initialize the allocator
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/LockFreeHashMap.h#L21">Jolt/Core/LockFreeHashMap.h:21</see>
|
|
/// <br/>
|
|
/// <c>inline void Init(uint inObjectStoreSizeBytes)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Initialize the allocator
|
|
/// @param inObjectStoreSizeBytes Number of bytes to reserve for all key value pairs
|
|
/// </code>
|
|
/// </remarks>
|
|
public void Init(uint objectStoreSizeBytes) => Jolt.PInvoke.LFHMAllocator_Init(this, objectStoreSizeBytes);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Clear all allocations
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/LockFreeHashMap.h#L24">Jolt/Core/LockFreeHashMap.h:24</see>
|
|
/// <br/>
|
|
/// <c>inline void Clear()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void Clear() => Jolt.PInvoke.LFHMAllocator_Clear(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Allocate a new block of data
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/LockFreeHashMap.h#L30">Jolt/Core/LockFreeHashMap.h:30</see>
|
|
/// <br/>
|
|
/// <c>inline void Allocate(uint32 inBlockSize, uint32 &ioBegin, uint32 &ioEnd)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Allocate a new block of data
|
|
/// @param inBlockSize Size of block to allocate (will potentially return a smaller block if memory is full).
|
|
/// @param ioBegin Should be the start of the first free byte in current memory block on input, will contain the start of the first free byte in allocated block on return.
|
|
/// @param ioEnd Should be the byte beyond the current memory block on input, will contain the byte beyond the allocated block on return.
|
|
/// </code>
|
|
/// </remarks>
|
|
public void Allocate(uint blockSize, ref uint begin, ref uint end) =>
|
|
Jolt.PInvoke.LFHMAllocator_Allocate(this, blockSize, ref begin, ref end);
|
|
|
|
public void Dispose() => Jolt.PInvoke.LFHMAllocator_Destroy(this);
|
|
}
|
|
}
|