You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reference accessor is actually super weird. First, an object is created. Then we check the handle and discard this object again. This puts unnecessary pressure on the GC.
I think we should just rename it to ReferenceFactory and refactor it to methods like this:
public static Output? Output(nint handle, bool shouldDispose)
{
return handle == nint.Zero ? null : new Output(handle, shouldDispose);
}
I like this idea. I'm not completely happy with ReferenceAccessor because it's just static code to centralize some operations but I didn't put a lot of thought here. It could be better.
However, let's finish #48 first then we discuss what to do here.
The reference accessor is actually super weird. First, an object is created. Then we check the handle and discard this object again. This puts unnecessary pressure on the GC.
I think we should just rename it to ReferenceFactory and refactor it to methods like this:
Depending on #48 it might event be obsolete.
Please assign me, if you agree. Happy to provide a PR.
The text was updated successfully, but these errors were encountered: