Dave Schuyler 23 years ago
parent
commit
35127b5d1b
1 changed files with 15 additions and 1 deletions
  1. 15 1
      panda/src/putil/uniqueIdAllocator.h

+ 15 - 1
panda/src/putil/uniqueIdAllocator.h

@@ -27,7 +27,21 @@ typedef unsigned long U32;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //       Class : UniqueIdAllocator
 //       Class : UniqueIdAllocator
-// Description : 
+// Description : Manage a set of ID values from min to max inclusive.
+//               The ID numbers that are freed will be allocated
+//               (reused) in the same order.  I.e. the oldest ID numbers
+//               will be allocated.
+//
+//               This implementation will use 4 bytes per id number,
+//               plus a few bytes of management data.  e.g. 10,000
+//               ID numbers will use 40KB.
+//
+//               There are other implementations that can better leverage
+//               runs of used or unused IDs or use bit arrays for the
+//               IDs.  But, it takes extra work to track the age of
+//               freed IDs, which is required for what we wanted.  If
+//               you would like to kick around other implementation
+//               ideas, please contact Schuyler.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 class EXPCL_PANDA UniqueIdAllocator {
 class EXPCL_PANDA UniqueIdAllocator {
 PUBLISHED:
 PUBLISHED: