@Override
	public void dataTypeSizeChanged(DataType dt) {
		if (dt instanceof BitFieldDataType) {
			return; // unsupported
		}
		lock.acquire();
		try {
			checkDeleted();
			if (isPackingEnabled()) {
				if (!repack(true, true)) {
					dataMgr.dataTypeChanged(this, true);
				}
				return;
			}
			int oldLength = structLength;
			boolean changed = false;
			boolean warn = false;
			int n = components.size();
			for (int i = 0; i < n; i++) {
				DataTypeComponentDB 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, true);
						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 (dtc.getLength() != length) {
						warn = true;
					}
				}
			}
			if (warn) {
				Msg.warn(this,
					"Failed to resize one or more structure components: " + getPathName());
			}
			if (changed) {
				repack(false, false);
				if (oldLength != structLength) {
					notifySizeChanged(false);
				}
				else {
					dataMgr.dataTypeChanged(this, false);
				}
			}
		}
		finally {
			lock.release();
		}
	}
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/database/data/StructureDB.java