HandleAllocator: Fix heap ordering using std::greater.
The default heap ordering is to return the greatest element in the
heap. Since the handle allocator expects a minimal return value on
a new allocation, this caused a bug. The bug is triggered by reserving
handles, allocating new handles, then freeing the handles and
allocating again with the same allocator. Fix the bug by using
std::greater instead of std::less, which will make the heap
return the smallest value instead of largest.
Also adds some logging debugging code for the handle allocators.
Bug: angleproject:1458
Change-Id: Ibef5dcbed0a664ccad0e0335f081e2355162584b
Reviewed-on: https://chromium-review.googlesource.com/848644
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
diff --git a/src/libANGLE/ResourceManager.cpp b/src/libANGLE/ResourceManager.cpp
index 79eb7e5..ebff5e5 100644
--- a/src/libANGLE/ResourceManager.cpp
+++ b/src/libANGLE/ResourceManager.cpp
@@ -260,6 +260,11 @@
}
}
+void TextureManager::enableHandleAllocatorLogging()
+{
+ mHandleAllocator.enableLogging(true);
+}
+
// RenderbufferManager Implementation.
// static