mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
65 lines
2.7 KiB
C#
65 lines
2.7 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>
|
|
/// Implementation of the TempAllocator that just falls back to malloc/free Note: This can be quite slow when
|
|
/// running in the debugger as large memory blocks need to be initialized with 0xcd
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L135">Jolt/Core/TempAllocator.h:135</see>
|
|
/// <br/>
|
|
/// <c>class TempAllocatorMalloc final : public TempAllocator</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[InteropHandle]
|
|
public readonly partial struct TempAllocatorMalloc : IDisposable
|
|
{
|
|
public static TempAllocatorMalloc Create() => Jolt.PInvoke.TempAllocatorMalloc_Create();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// See: TempAllocator
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L141">Jolt/Core/TempAllocator.h:141</see>
|
|
/// <br/>
|
|
/// <c>virtual void * Allocate(uint inSize) override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public unsafe Ptr Allocate(uint size) => Jolt.PInvoke.TempAllocatorMalloc_Allocate(this, size);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// See: TempAllocator
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L155">Jolt/Core/TempAllocator.h:155</see>
|
|
/// <br/>
|
|
/// <c>virtual void Free(void *inAddress, uint inSize) override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public unsafe void Free(Ptr address, uint size) => Jolt.PInvoke.TempAllocatorMalloc_Free(this, address, size);
|
|
|
|
public static implicit operator TempAllocator(TempAllocatorMalloc value) =>
|
|
Unsafe.BitCast<TempAllocatorMalloc, TempAllocator>(value);
|
|
|
|
public void Dispose() => Jolt.PInvoke.TempAllocatorMalloc_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);
|
|
}
|
|
}
|