protected void resyncAddressFactory(TraceAddressFactory factory) {

		// Perform reconciliation of overlay address spaces while attempting to preserve 
		// address space instances associated with a given key

		// Put all overlay records into key-based map
		Map<Long, DBTraceOverlaySpaceEntry> keyToRecordMap = new HashMap<>(overlayStore.asMap());

		// Examine existing overlay spaces for removals and renames
		List<ProgramOverlayAddressSpace> renameList = new ArrayList<>();
		for (AddressSpace space : factory.getAllAddressSpaces()) {
			if (space instanceof ProgramOverlayAddressSpace os) {
				String name = os.getName();
				DBTraceOverlaySpaceEntry ent = keyToRecordMap.get(os.getKey());
				if (ent == null || !isCompatibleOverlay(os, ent, factory)) {
					// Remove overlay if entry does not exist or base space differs
					factory.removeOverlaySpace(name);
				}
				else if (name.equals(ent.name)) {
					keyToRecordMap.remove(os.getKey());
					continue; // no change to space
				}
				else {
					// Add space to map of those that need to be renamed
					renameList.add(os);
					factory.removeOverlaySpace(name);
				}
			}
		}

		try {
			// Handle all renamed overlays which had been temporarily removed from factory
			for (ProgramOverlayAddressSpace existingSpace : renameList) {
				long key = existingSpace.getKey();
				DBTraceOverlaySpaceEntry ent = keyToRecordMap.get(key);
				existingSpace.setName(ent.name);
				factory.addOverlaySpace(existingSpace); // re-add renamed space
				keyToRecordMap.remove(key);
			}

			// Add any remaing overlay which are missing from factory
			for (long key : keyToRecordMap.keySet()) {
				DBTraceOverlaySpaceEntry ent = keyToRecordMap.get(key);
				String spaceName = ent.name;
				AddressSpace baseSpace = factory.getAddressSpace(ent.baseSpace);
				factory.addOverlaySpace(key, spaceName, baseSpace);
			}
		}
		catch (IllegalArgumentException | DuplicateNameException e) {
			throw new AssertionError("Unexpected error updating overlay address spaces", e);
		}

		factory.refreshStaleOverlayStatus();
	}
Used for objects having an {@link Address} field.

<p>
Most managers storing things by address will actually have a table per space, so the address
is encoded only as an offset. However, any other {@link Address} field (not constrained to
the same space) will need to encode the space information as well. This codec can do that.
The object will need to return its trace's space adapter, though.

@param <OT> the type of object containing the field
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/address/DBTraceOverlaySpaceAdapter.java