private void populateCache() throws IOException {
		if (callingConventionNameToIDMap != null) {
			return;
		}
		callingConventionNameToIDMap = new HashMap<>();
		callingConventionIDToNameMap = new HashMap<>();

		freeKeySet = TreeRangeSet.create();
		int nextKey = FIRST_CALLING_CONVENTION_ID;
		RecordIterator iterator = callingConventionTable.iterator();
		while (iterator.hasNext()) {
			DBRecord rec = iterator.next();

			byte id = (byte) rec.getKey();
			String name = rec.getString(V0_CALLING_CONVENTION_NAME_COL);
			callingConventionIDToNameMap.put(id, name);
			callingConventionNameToIDMap.put(name, id);

			if (nextKey != id) {
				freeKeySet.add(Range.closed((byte) nextKey, (byte) (id - 1)));
			}
			nextKey = id + 1;
		}
		if (nextKey <= Byte.MAX_VALUE) {
			freeKeySet.add(Range.closed((byte) nextKey, Byte.MAX_VALUE));
		}
	}
Remove next available free key value from freeKeySet.
@return the next available key. A negative value indicates that all allowed IDs have 
been used.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/CallingConventionDBAdapterV0.java