What's wrong with integer indices? They have bounds checking. You definitely do not need unsafe to do LRU.