diff options
| author | 2022-12-16 11:57:48 -0500 | |
|---|---|---|
| committer | 2022-12-16 11:57:48 -0500 | |
| commit | 789da737afe8e3b242d8adffb1444a663a78117d (patch) | |
| tree | 797f1d6f4f2f9faa970322dce426b5d00bf2a9eb | |
| parent | Merge pull request #9444 from german77/free_threads (diff) | |
| parent | hle_ipc: Reserve vectors before populating (diff) | |
| download | yuzu-789da737afe8e3b242d8adffb1444a663a78117d.tar.gz yuzu-789da737afe8e3b242d8adffb1444a663a78117d.tar.xz yuzu-789da737afe8e3b242d8adffb1444a663a78117d.zip | |
Merge pull request #9450 from ameerj/hle-ipc-vector-reserve
hle_ipc: Reserve vectors before populating
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 06010b8d1..e6479c131 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp | |||
| @@ -167,6 +167,9 @@ void HLERequestContext::ParseCommandBuffer(const KHandleTable& handle_table, u32 | |||
| 167 | } | 167 | } |
| 168 | if (incoming) { | 168 | if (incoming) { |
| 169 | // Populate the object lists with the data in the IPC request. | 169 | // Populate the object lists with the data in the IPC request. |
| 170 | incoming_copy_handles.reserve(handle_descriptor_header->num_handles_to_copy); | ||
| 171 | incoming_move_handles.reserve(handle_descriptor_header->num_handles_to_move); | ||
| 172 | |||
| 170 | for (u32 handle = 0; handle < handle_descriptor_header->num_handles_to_copy; ++handle) { | 173 | for (u32 handle = 0; handle < handle_descriptor_header->num_handles_to_copy; ++handle) { |
| 171 | incoming_copy_handles.push_back(rp.Pop<Handle>()); | 174 | incoming_copy_handles.push_back(rp.Pop<Handle>()); |
| 172 | } | 175 | } |
| @@ -181,6 +184,11 @@ void HLERequestContext::ParseCommandBuffer(const KHandleTable& handle_table, u32 | |||
| 181 | } | 184 | } |
| 182 | } | 185 | } |
| 183 | 186 | ||
| 187 | buffer_x_desciptors.reserve(command_header->num_buf_x_descriptors); | ||
| 188 | buffer_a_desciptors.reserve(command_header->num_buf_a_descriptors); | ||
| 189 | buffer_b_desciptors.reserve(command_header->num_buf_b_descriptors); | ||
| 190 | buffer_w_desciptors.reserve(command_header->num_buf_w_descriptors); | ||
| 191 | |||
| 184 | for (u32 i = 0; i < command_header->num_buf_x_descriptors; ++i) { | 192 | for (u32 i = 0; i < command_header->num_buf_x_descriptors; ++i) { |
| 185 | buffer_x_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorX>()); | 193 | buffer_x_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorX>()); |
| 186 | } | 194 | } |