mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2024-11-30 03:24:24 +01:00
Kernel: Address Feedback
This commit is contained in:
parent
0901c33753
commit
024b5fe91a
@ -52,7 +52,6 @@ public:
|
|||||||
using const_reference = const T&;
|
using const_reference = const T&;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
pointer address(reference r) {
|
pointer address(reference r) {
|
||||||
return std::addressof(r);
|
return std::addressof(r);
|
||||||
}
|
}
|
||||||
@ -62,11 +61,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
pointer allocate(size_type n) {
|
pointer allocate(size_type n) {
|
||||||
return static_cast<pointer>(::operator new(n, std::align_val_t{Align}));
|
return static_cast<pointer>(::operator new (n, std::align_val_t{Align}));
|
||||||
}
|
}
|
||||||
|
|
||||||
void deallocate(pointer p, size_type) {
|
void deallocate(pointer p, size_type) {
|
||||||
::operator delete(p, std::align_val_t{Align});
|
::operator delete (p, std::align_val_t{Align});
|
||||||
}
|
}
|
||||||
|
|
||||||
void construct(pointer p, const value_type& wert) {
|
void construct(pointer p, const value_type& wert) {
|
||||||
|
@ -8,6 +8,12 @@
|
|||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
|
// This encapsulation serves 2 purposes:
|
||||||
|
// - First, to encapsulate host physical memory under a single type and set an
|
||||||
|
// standard for managing it.
|
||||||
|
// - Second to ensure all host backing memory used is aligned to 256 bytes due
|
||||||
|
// to strict alignment restrictions on GPU memory.
|
||||||
|
|
||||||
using PhysicalMemory = std::vector<u8, Common::AlignmentAllocator<u8, 256>>;
|
using PhysicalMemory = std::vector<u8, Common::AlignmentAllocator<u8, 256>>;
|
||||||
|
|
||||||
}
|
} // namespace Kernel
|
||||||
|
@ -59,8 +59,8 @@ SharedPtr<SharedMemory> SharedMemory::Create(KernelCore& kernel, Process* owner_
|
|||||||
}
|
}
|
||||||
|
|
||||||
SharedPtr<SharedMemory> SharedMemory::CreateForApplet(
|
SharedPtr<SharedMemory> SharedMemory::CreateForApplet(
|
||||||
KernelCore& kernel, std::shared_ptr<Kernel::PhysicalMemory> heap_block, std::size_t offset, u64 size,
|
KernelCore& kernel, std::shared_ptr<Kernel::PhysicalMemory> heap_block, std::size_t offset,
|
||||||
MemoryPermission permissions, MemoryPermission other_permissions, std::string name) {
|
u64 size, MemoryPermission permissions, MemoryPermission other_permissions, std::string name) {
|
||||||
SharedPtr<SharedMemory> shared_memory(new SharedMemory(kernel));
|
SharedPtr<SharedMemory> shared_memory(new SharedMemory(kernel));
|
||||||
|
|
||||||
shared_memory->owner_process = nullptr;
|
shared_memory->owner_process = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user