diff options
| author | Jeannot Breton <jbreton@nvidia.com> | 2016-04-12 15:46:20 -0500 |
|---|---|---|
| committer | Jon Ashburn <jon@lunarg.com> | 2016-04-14 17:09:49 -0600 |
| commit | 9da62aa494820a37d6adb7ef5af1d65ca75ac5a1 (patch) | |
| tree | 495f68ad163cea3fe6483e3a185235dc1253c7e8 /loader | |
| parent | 7072544c6bd521acecf71434758cfa6a8a7aada0 (diff) | |
| download | usermoji-9da62aa494820a37d6adb7ef5af1d65ca75ac5a1.tar.xz | |
loader: dont free and reallocate physical devices
Change-Id: I68ac2681b7c4923213c65dc720f54d81a36c99ef
Diffstat (limited to 'loader')
| -rw-r--r-- | loader/trampoline.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/loader/trampoline.c b/loader/trampoline.c index c596cb7c..7b2293f6 100644 --- a/loader/trampoline.c +++ b/loader/trampoline.c @@ -563,14 +563,14 @@ vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, loader_platform_thread_unlock_mutex(&loader_lock); return VK_ERROR_INITIALIZATION_FAILED; } - if (inst->phys_devs) - loader_heap_free(inst, inst->phys_devs); count = (inst->total_gpu_count < *pPhysicalDeviceCount) ? inst->total_gpu_count : *pPhysicalDeviceCount; *pPhysicalDeviceCount = count; - inst->phys_devs = (struct loader_physical_device_tramp *)loader_heap_alloc( - inst, count * sizeof(struct loader_physical_device_tramp), - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (!inst->phys_devs) { + inst->phys_devs = (struct loader_physical_device_tramp *)loader_heap_alloc( + inst, inst->total_gpu_count * sizeof(struct loader_physical_device_tramp), + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + } if (!inst->phys_devs) { loader_platform_thread_unlock_mutex(&loader_lock); return VK_ERROR_OUT_OF_HOST_MEMORY; |
