UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMSubspace.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#if WITH_VERSE_VM || defined(__INTELLISENSE__)
6
7#include "verse_heap_ue.h"
8#include <cstddef>
9
10namespace Verse
11{
12struct FAllocationContext;
13
14// This is really a pas_heap. Hence, we don't let you create it directly. We create a pas_heap
15// and cast to this.
16class FSubspace final
17{
18public:
19 static FSubspace* Create(size_t MinAlign = 1, size_t ReservationSize = 0, size_t ReservationAlignment = 1)
20 {
21 return reinterpret_cast<FSubspace*>(verse_heap_create(MinAlign, ReservationSize, ReservationAlignment));
22 }
23
24 std::byte* GetBase() const
25 {
26 return static_cast<std::byte*>(verse_heap_get_base(const_cast<pas_heap*>(reinterpret_cast<const pas_heap*>(this))));
27 }
28
29private:
30 friend struct FAllocationContext;
31 friend struct FContextImpl;
32
33 std::byte* TryAllocate(size_t Size)
34 {
35 return static_cast<std::byte*>(verse_heap_try_allocate(reinterpret_cast<pas_heap*>(this), Size));
36 }
37 std::byte* TryAllocate(size_t Size, size_t Alignment)
38 {
39 return static_cast<std::byte*>(verse_heap_try_allocate_with_alignment(reinterpret_cast<pas_heap*>(this), Size, Alignment));
40 }
41 std::byte* Allocate(size_t Size)
42 {
43 return static_cast<std::byte*>(verse_heap_allocate(reinterpret_cast<pas_heap*>(this), Size));
44 }
45 std::byte* Allocate(size_t Size, size_t Alignment)
46 {
47 return static_cast<std::byte*>(verse_heap_allocate_with_alignment(reinterpret_cast<pas_heap*>(this), Size, Alignment));
48 }
49
50 FSubspace() = delete;
51 FSubspace(const FSubspace&) = delete;
52};
53
54} // namespace Verse
55#endif // WITH_VERSE_VM
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32 Size
Definition VulkanMemory.cpp:4034
Definition Archive.h:36