I have entities which are created and destroyed. each entity has an identifier (int). for now my allocation is simply an incremented counter. I want to improve allocation by reusing the identifiers of destroyed entities rather than incrementing when possible. what is the best way to implement that (in terms of both memory and performance)? one problem I have is that when I reach max int I don't even know how to allocate the next id.