Index: gpu/command_buffer/common/id_allocator.h |
=================================================================== |
--- gpu/command_buffer/common/id_allocator.h (revision 86796) |
+++ gpu/command_buffer/common/id_allocator.h (working copy) |
@@ -44,9 +44,14 @@ |
// TODO(gman): This would work much better with ranges or a hash table. |
typedef std::set<ResourceId> ResourceIdSet; |
greggman
2011/05/26 16:25:29
If were doing this for speed, how about changing t
|
- ResourceId FindFirstFree() const; |
+ // The highest ID on the used list. |
+ ResourceId LastUsedId() const; |
+ // Lowest ID that isn't on the used list. This is slow, use as a last resort. |
+ ResourceId FindFirstUnusedId() const; |
+ |
ResourceIdSet used_ids_; |
+ ResourceIdSet free_ids_; |
DISALLOW_COPY_AND_ASSIGN(IdAllocator); |
}; |