From: Mikko Rasa Date: Tue, 8 Mar 2022 13:58:57 +0000 (+0200) Subject: Minor tweaks to MemoryAllocator X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4795cdfc7936ac89da46f4d6f9de33fd481933a4;p=libs%2Fgl.git Minor tweaks to MemoryAllocator --- diff --git a/source/backends/vulkan/memoryallocator.cpp b/source/backends/vulkan/memoryallocator.cpp index 4b3595b6..82155faf 100644 --- a/source/backends/vulkan/memoryallocator.cpp +++ b/source/backends/vulkan/memoryallocator.cpp @@ -56,7 +56,7 @@ MemoryAllocator::~MemoryAllocator() vk.FreeMemory(r.memory); } -unsigned MemoryAllocator::find_memory_pool(unsigned mask, MemoryType type) +unsigned MemoryAllocator::find_memory_pool(unsigned mask, MemoryType type) const { for(unsigned i=0; i::iterator MemoryAllocator::lower_bound_by_size(vector &indices, size_t size) +vector::iterator MemoryAllocator::lower_bound_by_size(vector &indices, size_t size) const { return lower_bound(indices, size, [this](unsigned j, unsigned s){ return blocks[j].size::iterator lower_bound_by_size(std::vector &, std::size_t); + std::vector::iterator lower_bound_by_size(std::vector &, std::size_t) const; unsigned allocate(std::size_t, std::size_t, unsigned, MemoryType); unsigned split_block(unsigned, std::size_t); void consolidate(unsigned);