mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2026-03-22 01:35:55 -05:00
30 lines
1.0 KiB
C++
30 lines
1.0 KiB
C++
#pragma once
|
|
#include "DefaultPluginHeapMemoryAllocator.h"
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
#include <cstdint>
|
|
|
|
class TrackingPluginHeapMemoryAllocator : public IPluginHeapMemoryAllocator {
|
|
public:
|
|
static std::optional<TrackingPluginHeapMemoryAllocator> Create(std::string_view pluginName, uint32_t stackTraceDepth);
|
|
|
|
~TrackingPluginHeapMemoryAllocator() override;
|
|
|
|
TrackingPluginHeapMemoryAllocator(const TrackingPluginHeapMemoryAllocator &) = delete;
|
|
|
|
TrackingPluginHeapMemoryAllocator(TrackingPluginHeapMemoryAllocator &&src) noexcept;
|
|
|
|
TrackingPluginHeapMemoryAllocator &operator=(TrackingPluginHeapMemoryAllocator &&src) noexcept;
|
|
|
|
MEMAllocFromDefaultHeapFn *GetAllocFunctionAddress() const override;
|
|
MEMAllocFromDefaultHeapExFn *GetAllocExFunctionAddress() const override;
|
|
MEMFreeToDefaultHeapFn *GetFreeFunctionAddress() const override;
|
|
std::optional<PluginMemorySnapshot> GetHeapMemoryUsageSnapshot() const override;
|
|
|
|
private:
|
|
int sIndex = -1;
|
|
TrackingPluginHeapMemoryAllocator(int index);
|
|
};
|