How would you implement a data structure similar to the Symbian OS cleanup stack, but which would allow removal of items from the data structure based on name, reference, or some other identifier? How does your implementation correspond to the Symbian OS solution in terms of complexity and performance? Could the data structure be used for garbage collection as well?