mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-12-26 06:10:07 +00:00
hle_ipc: Use shared_ptr instead of unique_ptr to allow copies.
This commit is contained in:
parent
019f1a0cf0
commit
2faa83ca13
@ -35,7 +35,7 @@ HLERequestContext::~HLERequestContext() = default;
|
|||||||
|
|
||||||
void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
|
void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
|
||||||
IPC::RequestParser rp(src_cmdbuf);
|
IPC::RequestParser rp(src_cmdbuf);
|
||||||
command_header = std::make_unique<IPC::CommandHeader>(rp.PopRaw<IPC::CommandHeader>());
|
command_header = std::make_shared<IPC::CommandHeader>(rp.PopRaw<IPC::CommandHeader>());
|
||||||
|
|
||||||
if (command_header->type == IPC::CommandType::Close) {
|
if (command_header->type == IPC::CommandType::Close) {
|
||||||
// Close does not populate the rest of the IPC header
|
// Close does not populate the rest of the IPC header
|
||||||
@ -45,7 +45,7 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
|
|||||||
// If handle descriptor is present, add size of it
|
// If handle descriptor is present, add size of it
|
||||||
if (command_header->enable_handle_descriptor) {
|
if (command_header->enable_handle_descriptor) {
|
||||||
handle_descriptor_header =
|
handle_descriptor_header =
|
||||||
std::make_unique<IPC::HandleDescriptorHeader>(rp.PopRaw<IPC::HandleDescriptorHeader>());
|
std::make_shared<IPC::HandleDescriptorHeader>(rp.PopRaw<IPC::HandleDescriptorHeader>());
|
||||||
if (handle_descriptor_header->send_current_pid) {
|
if (handle_descriptor_header->send_current_pid) {
|
||||||
rp.Skip(2, false);
|
rp.Skip(2, false);
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
|
|||||||
// All outgoing domain messages have the domain header, if only incoming has it
|
// All outgoing domain messages have the domain header, if only incoming has it
|
||||||
if (incoming || domain_message_header) {
|
if (incoming || domain_message_header) {
|
||||||
domain_message_header =
|
domain_message_header =
|
||||||
std::make_unique<IPC::DomainMessageHeader>(rp.PopRaw<IPC::DomainMessageHeader>());
|
std::make_shared<IPC::DomainMessageHeader>(rp.PopRaw<IPC::DomainMessageHeader>());
|
||||||
} else {
|
} else {
|
||||||
if (Session()->IsDomain())
|
if (Session()->IsDomain())
|
||||||
LOG_WARNING(IPC, "Domain request has no DomainMessageHeader!");
|
LOG_WARNING(IPC, "Domain request has no DomainMessageHeader!");
|
||||||
@ -96,7 +96,7 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data_payload_header =
|
data_payload_header =
|
||||||
std::make_unique<IPC::DataPayloadHeader>(rp.PopRaw<IPC::DataPayloadHeader>());
|
std::make_shared<IPC::DataPayloadHeader>(rp.PopRaw<IPC::DataPayloadHeader>());
|
||||||
|
|
||||||
data_payload_offset = rp.GetCurrentOffset();
|
data_payload_offset = rp.GetCurrentOffset();
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ public:
|
|||||||
return buffer_c_desciptors;
|
return buffer_c_desciptors;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::unique_ptr<IPC::DomainMessageHeader>& GetDomainMessageHeader() const {
|
const std::shared_ptr<IPC::DomainMessageHeader>& GetDomainMessageHeader() const {
|
||||||
return domain_message_header;
|
return domain_message_header;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,10 +212,10 @@ private:
|
|||||||
boost::container::small_vector<SharedPtr<Object>, 8> copy_objects;
|
boost::container::small_vector<SharedPtr<Object>, 8> copy_objects;
|
||||||
boost::container::small_vector<std::shared_ptr<SessionRequestHandler>, 8> domain_objects;
|
boost::container::small_vector<std::shared_ptr<SessionRequestHandler>, 8> domain_objects;
|
||||||
|
|
||||||
std::unique_ptr<IPC::CommandHeader> command_header;
|
std::shared_ptr<IPC::CommandHeader> command_header;
|
||||||
std::unique_ptr<IPC::HandleDescriptorHeader> handle_descriptor_header;
|
std::shared_ptr<IPC::HandleDescriptorHeader> handle_descriptor_header;
|
||||||
std::unique_ptr<IPC::DataPayloadHeader> data_payload_header;
|
std::shared_ptr<IPC::DataPayloadHeader> data_payload_header;
|
||||||
std::unique_ptr<IPC::DomainMessageHeader> domain_message_header;
|
std::shared_ptr<IPC::DomainMessageHeader> domain_message_header;
|
||||||
std::vector<IPC::BufferDescriptorX> buffer_x_desciptors;
|
std::vector<IPC::BufferDescriptorX> buffer_x_desciptors;
|
||||||
std::vector<IPC::BufferDescriptorABW> buffer_a_desciptors;
|
std::vector<IPC::BufferDescriptorABW> buffer_a_desciptors;
|
||||||
std::vector<IPC::BufferDescriptorABW> buffer_b_desciptors;
|
std::vector<IPC::BufferDescriptorABW> buffer_b_desciptors;
|
||||||
|
Loading…
Reference in New Issue
Block a user