private ProgramOverlayAddressSpace createUniqueOverlaySpace(String overlaySpaceName,
			AddressSpace baseSpace) throws IllegalStateException, LockException {

		ProgramAddressFactory addressFactory = program.getAddressFactory();
		overlaySpaceName = fixupOverlaySpaceName(overlaySpaceName);
		String spaceName = overlaySpaceName;
		int index = 1;
		while (addressFactory.getAddressSpace(spaceName) != null) {
			spaceName = overlaySpaceName + "." + index++;
		}
		try {
			return program.createOverlaySpace(spaceName, baseSpace);
		}
		catch (DuplicateNameException | InvalidNameException e) {
			throw new AssertionError(e);
		}
	}
Create a new overlay space based upon the given base AddressSpace.
The specified overlaySpaceName may be modified to ensure name validity and uniqueness.
@param overlaySpaceName the name of the new overlay space.
@param baseSpace the base AddressSpace to overlay (i.e., overlayed-space)
@return the new overlay space
@throws LockException if the program is shared and not checked out exclusively.
@throws IllegalStateException if image base override is active
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/mem/MemoryMapDB.java