@Override
	protected boolean isEquivalent(DataType dataType, DataTypeConflictHandler handler) {
		if (dataType == this) {
			return true;
		}
		if (!(dataType instanceof StructureInternal struct)) {
			return false;
		}

		validate(lock);
		if (resolving) { // actively resolving children
			if (dataType.getUniversalID().equals(getUniversalID())) {
				return true;
			}
			return DataTypeUtilities.equalsIgnoreConflict(getPathName(), dataType.getPathName());
		}

		Boolean isEquivalent = dataMgr.getCachedEquivalence(this, dataType);
		if (isEquivalent != null) {
			return isEquivalent;
		}

		try {
			isEquivalent = false;

			if (handler != null &&
				ConflictResult.USE_EXISTING == handler.resolveConflict(struct, this)) {
				// treat this type as equivalent if existing type will be used
				isEquivalent = true;
				return true;
			}

			int otherLength = struct.isZeroLength() ? 0 : struct.getLength();
			int packing = getStoredPackingValue();
			if (packing != struct.getStoredPackingValue() ||
				getStoredMinimumAlignment() != struct.getStoredMinimumAlignment() ||
				(packing == NO_PACKING && structLength != otherLength)) {
				return false;
			}

			int myNumComps = components.size();
			int otherNumComps = struct.getNumDefinedComponents();
			if (myNumComps != otherNumComps) {
				return false;
			}
			DataTypeComponent[] otherDefinedComponents = struct.getDefinedComponents();
			if (otherDefinedComponents.length != myNumComps) { // safety check
				return false;
			}
			if (handler != null) {
				handler = handler.getSubsequentHandler();
				//dataMgr.getPostResolve(this);
			}
			for (int i = 0; i < myNumComps; i++) {
				DataTypeComponent myDtc = components.get(i);
				DataTypeComponent otherDtc = otherDefinedComponents[i];
				if (!DataTypeComponentDB.isEquivalent(myDtc, otherDtc, handler)) {
					return false;
				}
			}
			isEquivalent = true;
		}
		finally {
			dataMgr.putCachedEquivalence(this, dataType, isEquivalent);
		}
		return true;
	}
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