//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// C++:
/// Jolt/Core/TempAllocator.h:15
///
/// class TempAllocator : public NonCopyable
///
///
///
///
/// Allocator for temporary allocations.
/// This allocator works as a stack: The blocks must always be freed in the reverse order as they are allocated.
/// Note that allocations and frees can take place from different threads, but the order is guaranteed though
/// job dependencies, so it is not needed to use any form of locking.
///
///
[InteropHandle]
public readonly partial struct TempAllocator
{
///
///
/// C++:
/// Jolt/Core/TempAllocator.h:27
///
/// virtual void * Allocate(uint inSize) = 0
///
///
///
///
/// Allocates inSize bytes of memory, returned memory address must be JPH_RVECTOR_ALIGNMENT byte aligned
///
///
public unsafe Ptr Allocate(ByteSize size) => Jolt.PInvoke.TempAllocator_Allocate(this, (uint)size);
///
///
/// C++:
/// Jolt/Core/TempAllocator.h:30
///
/// virtual void Free(void *inAddress, uint inSize) = 0
///
///
///
///
/// Frees inSize bytes of memory located at inAddress
///
///
public unsafe void Free(Ptr address, ByteSize size) => Jolt.PInvoke.TempAllocator_Free(this, address, (uint)size);
}
}