mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
78 lines
3.3 KiB
C#
78 lines
3.3 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 tries to allocate from a large preallocated block, but falls back
|
|
/// to malloc when it is exhausted
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L168">Jolt/Core/TempAllocator.h:168</see>
|
|
/// <br/>
|
|
/// <c>class TempAllocatorImplWithMallocFallback final : public TempAllocator</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[InteropHandle]
|
|
public readonly partial struct TempAllocatorImplWithMallocFallback : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Constructs the allocator with an initial fixed block if inSize
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L174">Jolt/Core/TempAllocator.h:174</see>
|
|
/// <br/>
|
|
/// <c>explicit TempAllocatorImplWithMallocFallback(uint inSize)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static TempAllocatorImplWithMallocFallback Create(uint size) =>
|
|
Jolt.PInvoke.TempAllocatorImplWithMallocFallback_Create(size);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// See: TempAllocator
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L180">Jolt/Core/TempAllocator.h:180</see>
|
|
/// <br/>
|
|
/// <c>virtual void * Allocate(uint inSize) override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public unsafe Ptr Allocate(uint size) => Jolt.PInvoke.TempAllocatorImplWithMallocFallback_Allocate(this, size);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// See: TempAllocator
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Core/TempAllocator.h#L189">Jolt/Core/TempAllocator.h:189</see>
|
|
/// <br/>
|
|
/// <c>virtual void Free(void *inAddress, uint inSize) override</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public unsafe void Free(Ptr address, uint size) =>
|
|
Jolt.PInvoke.TempAllocatorImplWithMallocFallback_Free(this, address, size);
|
|
|
|
public static implicit operator TempAllocator(TempAllocatorImplWithMallocFallback value) =>
|
|
Unsafe.BitCast<TempAllocatorImplWithMallocFallback, TempAllocator>(value);
|
|
|
|
public void Dispose() => Jolt.PInvoke.TempAllocatorImplWithMallocFallback_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);
|
|
}
|
|
}
|