private void checkUndefinedSpaceAvailabilityAfter(int lastOrdinalReplacedOrUpdated,
			int bytesNeeded, DataType newDataType, int offset) throws IllegalArgumentException {
		if (bytesNeeded <= 0) {
			return;
		}
		int bytesAvailable = getNumUndefinedBytes(lastOrdinalReplacedOrUpdated + 1);
		if (bytesAvailable < bytesNeeded) {
			if (lastOrdinalReplacedOrUpdated == getLastDefinedComponentOrdinal()) {
				growStructure(bytesNeeded - bytesAvailable);
			}
			else {
				throw new IllegalArgumentException("Not enough undefined bytes to fit " +
					newDataType.getPathName() + " in structure " + getPathName() + " at offset 0x" +
					Integer.toHexString(offset) + "." + " It needs " +
					(bytesNeeded - bytesAvailable) + " more byte(s) to be able to fit.");
			}
		}
	}
Check for available undefined bytes within a non-packed structure for a component update
with the specified ordinal.
@param lastOrdinalReplacedOrUpdated the ordinal of a component to be updated or the last
ordinal with in a sequence of components being replaced.
@param bytesNeeded number of additional bytes required to complete operation
@throws IllegalArgumentException if unable to identify/make sufficient space
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/StructureDB.java