mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
140 lines
5.8 KiB
C#
140 lines
5.8 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>
|
|
/// Default implementation of the temp allocator that allocates a large block through malloc upfront
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L34">Jolt/Core/TempAllocator.h:34</see>
|
|
/// <br/>
|
|
/// <c>class TempAllocatorImpl final : public TempAllocator</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[InteropHandle]
|
|
public readonly partial struct TempAllocatorImpl : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Constructs the allocator with a maximum allocatable size of inSize
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L40">Jolt/Core/TempAllocator.h:40</see>
|
|
/// <br/>
|
|
/// <c>explicit TempAllocatorImpl(size_t inSize)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static TempAllocatorImpl Create(nuint size) => Jolt.PInvoke.TempAllocatorImpl_Create(size);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// See: TempAllocator
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L59">Jolt/Core/TempAllocator.h:59</see>
|
|
/// <br/>
|
|
/// <c>virtual void * Allocate(uint inSize) override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public unsafe Ptr Allocate(uint size) => Jolt.PInvoke.TempAllocatorImpl_Allocate(this, size);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// See: TempAllocator
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L80">Jolt/Core/TempAllocator.h:80</see>
|
|
/// <br/>
|
|
/// <c>virtual void Free(void *inAddress, uint inSize) override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public unsafe void Free(Ptr address, uint size) => Jolt.PInvoke.TempAllocatorImpl_Free(this, address, size);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Check if no allocations have been made
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L98">Jolt/Core/TempAllocator.h:98</see>
|
|
/// <br/>
|
|
/// <c>bool IsEmpty() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public bool IsEmpty() => Jolt.PInvoke.TempAllocatorImpl_IsEmpty(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the total size of the fixed buffer
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L104">Jolt/Core/TempAllocator.h:104</see>
|
|
/// <br/>
|
|
/// <c>size_t GetSize() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public ByteSize GetSize() => (ByteSize)Jolt.PInvoke.TempAllocatorImpl_GetSize(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get current usage in bytes of the buffer
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L110">Jolt/Core/TempAllocator.h:110</see>
|
|
/// <br/>
|
|
/// <c>size_t GetUsage() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public ByteSize GetUsage() => (ByteSize)Jolt.PInvoke.TempAllocatorImpl_GetUsage(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Check if an allocation of inSize can be made in this fixed buffer allocator
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L116">Jolt/Core/TempAllocator.h:116</see>
|
|
/// <br/>
|
|
/// <c>bool CanAllocate(uint inSize) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public bool CanAllocate(uint size) => Jolt.PInvoke.TempAllocatorImpl_CanAllocate(this, size);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Check if memory block at inAddress is owned by this allocator
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L122">Jolt/Core/TempAllocator.h:122</see>
|
|
/// <br/>
|
|
/// <c>bool OwnsMemory(const void *inAddress) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public unsafe bool OwnsMemory(Ptr address) => Jolt.PInvoke.TempAllocatorImpl_OwnsMemory(this, address);
|
|
|
|
public static implicit operator TempAllocator(TempAllocatorImpl value) =>
|
|
Unsafe.BitCast<TempAllocatorImpl, TempAllocator>(value);
|
|
|
|
public void Dispose() => Jolt.PInvoke.TempAllocatorImpl_Destroy(this);
|
|
|
|
/// <inheritdoc cref="TempAllocator.Allocate(ByteSize)"/>
|
|
public unsafe Ptr Allocate(ByteSize size) => ((TempAllocator)this).Allocate(size);
|
|
|
|
/// <inheritdoc cref="TempAllocator.Free(Ptr, ByteSize)"/>
|
|
public unsafe void Free(Ptr address, ByteSize size) => ((TempAllocator)this).Free(address, size);
|
|
}
|
|
}
|