private boolean hasNoMemoryConflicts() {
		if (isOverlay) {
			return true;
		}
		Address endAddr = startAddr.add(length - 1);
		AddressSet intersectRange = program.getMemory().intersectRange(startAddr, endAddr);
		if (!intersectRange.isEmpty()) {
			AddressRange firstRange = intersectRange.getFirstRange();
			message = "Block address conflict: " + firstRange;
			return false;
		}
		return true;
	}
Model to manage adding a memory block.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/memory/AddBlockModel.java