mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Do not copy std::vector of OS handles when it is not needed
This change replaces unneeded copying of std::vectors with usage of const references. Furthermore, it adds reserve() call before filling the container via push_back(). Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
40ddeeb3ba
commit
9b26e96b11
@@ -508,6 +508,8 @@ ze_result_t ContextImp::openIpcMemHandles(ze_device_handle_t hDevice,
|
||||
ze_ipc_memory_flags_t flags,
|
||||
void **pptr) {
|
||||
std::vector<NEO::osHandle> handles;
|
||||
handles.reserve(numIpcHandles);
|
||||
|
||||
for (uint32_t i = 0; i < numIpcHandles; i++) {
|
||||
uint64_t handle = 0;
|
||||
memcpy_s(&handle,
|
||||
|
||||
Reference in New Issue
Block a user