reduce export count by separating bridge and implementation #113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this PR seperates the bridge and implementation and makes all implementation of interfaces internal.
prior to this pr the "implementation" served two purposes:
InterfaceWrapper
.The
InterfaceWrapper
has to be public so that it can be referenced across modules. However, we don't technically need to have the implementation be public. The only thing that needs to be public is theBridge
. TheBridge
is what tells the wrapper how to translate between C pointers and Swift objects. The wrapper takes the contract specified by theBridge
and actually holds the VTable and Swift objects. This wrapper is passed to WinRT and is also what knows how to unwrap a pointer via checking for theISwiftImplemented
interface.Future improvements could fold the bridge into the wrapper, but this is a good first step.
This reduces the number of exports in WinUI.dll by 7k. Since marking APIs as internal doesn't reduce exports in debug builds, future reductions would be to write types on a per file basis. This would let us mark certain details as
fileprivate
FIXES WIN-915