@Override
	public void dataTypeSizeChanged(DataType dt) {
		if (dt instanceof BitFieldDataType) {
			return; // unsupported
		}
		if (isPackingEnabled()) {
			repack(true);
			return;
		}
		int oldLength = structLength;
		boolean changed = false;
		int n = components.size();
		for (int i = 0; i < n; i++) {
			DataTypeComponentImpl dtc = components.get(i);
			if (dtc.getDataType() == dt) {
				// assume no impact to bitfields since base types should not change size
				int dtcLen = dtc.getLength();

				int length = getPreferredComponentLength(dt, dtcLen, getAvailableComponentSpace(i));

				if (length < dtcLen) {
					dtc.setLength(length);
					shiftOffsets(i + 1, dtcLen - length, 0); // updates structure record and last modified time
					changed = true;
				}
				else if (length > dtcLen) {
					int consumed = consumeBytesAfter(i, length - dtcLen); // updates component record
					if (consumed > 0) {
						shiftOffsets(i + 1, -consumed, 0); // updates structure record and last modified time
						changed = true;
					}
				}
			}
		}
		if (changed) {
			repack(false);
			if (oldLength != structLength) {
				notifySizeChanged();
			}
		}
	}
Get the available space for an existing defined component in relation to the next defined 
component or the end of the structure.  Method should be used in conjunction with
{@link #consumeBytesAfter(int, int)} and/or {@link #shiftOffsets(int, int, int)} for
non-packed structure use.  This method is intended to supplt the maxLength parameter
for the {@link #getPreferredComponentLength(DataType, int, int)} method call.

@param index defined components index
@return available space for this component (i.e., maxLength). {@link Integer#MAX_VALUE} 
is returned if last component in non-packed structure, or -1 if structure is packed.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/StructureDataType.java