public void deallocate(int index) {
        if ((index < 0) || (index >= nextIndex)) {
            throw new IndexOutOfBoundsException();
        }

        if (index == nextIndex-1) {
            nextIndex--;
        }
        else {
            freeList.add(Integer.valueOf(index));
        }

        // all nodes are free, so reset...
        if (nextIndex == freeList.size()) {
            clear();
        }
    }
Returns the index value so that it can be reused.
@param index the index to be free'd for reuse.
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/IntIndexManager.java