This utility will be used in future commits.
Also add -Wno-undefined to the linker flags to prevent leaving
undefined symbols in the layer .so file. Fix issues highlighted while
using this flag.
Change-Id: I682e266f7b3f313742cb2da83e5ad2569fc72da3
Signed-off-by: Joe Jenner-Bailey <joe.jenner-bailey@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
Change util::allocator's create and destroy methods so that they can
allocate multiple objects, in line with the allocate and deallocate
methods of std::allocator.
Also add documentation for util::allocator and its methods.
Finally, use util::allocator in swapchain.cpp, rather than allocating
memory directly via VkAllocationCallbacks.
Change-Id: I0bc25abe3cbc3af9608218411da8d70e04dd9749
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
Add util::vector to provide functionality similar to std::vector,
i.e. growable arrays. util::vector does its allocations via a custom
allocator provided via VkAllocationCallbacks and provides methods to
check whether the allocation fails, e.g. try_push_back() returns false
when the allocation fails and replaces std::vector's push_back() method
that would rather raise an exception to report an allocation failure.
Note that this commit switches on exceptions in the layer by removing
the flag -fno-exceptions.
util::vector is also used to store swapchain images.
Change-Id: I2bf2b24bd06e198c198c4f4aedd8f7fced96a346
Signed-off-by: Joe Jenner-Bailey <joe.jenner-bailey@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>