int getLength() {
		if (lastComponent == null) {
			return 0;
		}
		int offset = 0;
		if (groupOffset >= 0 && lastComponent.isBitFieldComponent() &&
			bitFieldPacking.useMSConvention()) {
			// skip beyond unused bits based upon allocation size
			BitFieldDataType lastBitFieldDt = (BitFieldDataType) lastComponent.getDataType();
			offset = groupOffset + lastBitFieldDt.getBaseTypeSize();
		}
		else {
			offset = lastComponent.getOffset() + lastComponent.getLength();
			if (!bitFieldPacking.useMSConvention() && lastComponent.isZeroBitFieldComponent()) {
				// factor in trailing zero-length bitfield
				// TODO: does pack setting need to be considered?
				BitFieldDataType bitfieldDt = (BitFieldDataType) lastComponent.getDataType();
				int sizeAlignment = bitfieldDt.getBaseDataType().getAlignment();
				getBitFieldAlignment((BitFieldDataType) lastComponent.getDataType());
				offset = DataOrganizationImpl.getAlignedOffset(sizeAlignment, offset);
			}
		}
		return offset;
	}
Get structure length after all components have been added.
@return structure length
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AlignedComponentPacker.java