-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge make functions into getters. #1482
base: staging/AOT
Are you sure you want to change the base?
Merge make functions into getters. #1482
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you measured any size change with NAOT?
Can you include a screenshot with before/after with sizoscope?
I haven't tested with any NativeAOT scenario. |
Mmh actually looking at updated projections I see this: private static IObjectReference _objRef_global__Microsoft_Graphics_Canvas_CanvasDevice
{
get
{
IObjectReference canvasCanvasDevice = CanvasDevice.___objRef_global__Microsoft_Graphics_Canvas_CanvasDevice;
return canvasCanvasDevice != null && canvasCanvasDevice.IsInCurrentContext ? canvasCanvasDevice : (CanvasDevice.___objRef_global__Microsoft_Graphics_Canvas_CanvasDevice = ActivationFactory.Get("Microsoft.Graphics.Canvas.CanvasDevice"));
}
}
public CanvasDevice()
: this((IObjectReference) IActivationFactoryMethods.ActivateInstance<IUnknownVftbl>(CanvasDevice._objRef_global__Microsoft_Graphics_Canvas_CanvasDevice))
{
ComWrappersSupport.RegisterObjectForInterface((object) this, this.ThisPtr);
ComWrappersHelper.Init(this._inner, false);
} Can you explain that |
That is exactly what it does. We only cache one factory and if the cached version requires a different apartment, we create a new one and cache that. For free-threaded factories we cache the first one forever (IsInCurrentContext will always be true). |
210313b
to
c895b0d
Compare
c895b0d
to
ba34694
Compare
Results in small size gain.