Is this size a copy-paste error? should it be freeSpace1stTo2ndEnd instead?
The outer loop reads while (lastOffset < freeSpace1stTo2ndEnd) so I would assume the inner variable needs to match its outer condition (hence, the size -> freeSpace1stTo2ndEnd fix, which is what Coverity proposed originally).
For comparison, L7502 and L7535 are comparing directly against freeSpace2ndTo1stEnd but not against the size variable itself.
Hello,
I need some help while trying to identify a potential copy-paste bug. An automated Coverity test raised an issue here, regarding line,
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/blob/94b1acaef0d1fa6f721559a5f0f3ee31d5efba00/include/vk_mem_alloc.h#L7584
Is this
size
a copy-paste error? should it befreeSpace1stTo2ndEnd
instead? The outer loop readswhile (lastOffset < freeSpace1stTo2ndEnd)
so I would assume the inner variable needs to match its outer condition (hence, thesize
->freeSpace1stTo2ndEnd
fix, which is what Coverity proposed originally).For comparison, L7502 and L7535 are comparing directly against
freeSpace2ndTo1stEnd
but not against thesize
variable itself.Links:
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/blob/94b1acaef0d1fa6f721559a5f0f3ee31d5efba00/include/vk_mem_alloc.h#L7502 https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/blob/94b1acaef0d1fa6f721559a5f0f3ee31d5efba00/include/vk_mem_alloc.h#L7535
Thanks in advance :D