mirror of
https://github.com/RPCSX/rpcsx.git
synced 2024-11-23 03:19:47 +00:00
[rpcsx-os] dmem: fix allocator
This commit is contained in:
parent
84a8523568
commit
a98ac71b83
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "io-device.hpp"
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/error/ErrorCode.hpp"
|
||||
#include "orbis/file.hpp"
|
||||
#include "orbis/utils/Rc.hpp"
|
||||
@ -21,7 +22,7 @@ struct DmemDevice : public IoDevice {
|
||||
auto operator<=>(const AllocationInfo &) const = default;
|
||||
};
|
||||
|
||||
rx::MemoryTableWithPayload<AllocationInfo> allocations;
|
||||
rx::MemoryTableWithPayload<AllocationInfo, orbis::kallocator> allocations;
|
||||
|
||||
orbis::ErrorCode allocate(std::uint64_t *start, std::uint64_t searchEnd,
|
||||
std::uint64_t len, std::uint64_t alignment,
|
||||
|
@ -202,9 +202,13 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template <typename PayloadT> class MemoryTableWithPayload {
|
||||
template <typename PayloadT,
|
||||
template <typename> typename Allocator = std::allocator>
|
||||
class MemoryTableWithPayload {
|
||||
enum class Kind { O, X, XO };
|
||||
std::map<std::uint64_t, std::pair<Kind, PayloadT>> mAreas;
|
||||
std::map<std::uint64_t, std::pair<Kind, PayloadT>, std::less<>,
|
||||
Allocator<std::pair<const std::uint64_t, std::pair<Kind, PayloadT>>>>
|
||||
mAreas;
|
||||
|
||||
public:
|
||||
struct AreaInfo {
|
||||
|
Loading…
Reference in New Issue
Block a user