Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Connection - remove closure allocation #317

Merged
merged 1 commit into from
Nov 4, 2015

Conversation

benaadams
Copy link
Contributor

No closure or delegate allocation now

@benaadams benaadams changed the title Don't capture connection on closure Connection - remove closure allocation Nov 1, 2015
private static readonly Action<UvStreamHandle, int, object> _readCallback = ReadCallback;
private static readonly Func<UvStreamHandle, int, object, Libuv.uv_buf_t> _allocCallback = AllocCallback;
private static readonly Action<UvStreamHandle, int, object> _readCallback =
(handle, status, state) => ReadCallback(handle, status, state);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have to use the => to remove the closure allocation? I think I remember that being the case at one point, but I figured that was a compiler bug that should be fixed by now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep; I'd agree is bug; but not fixed yet: dotnet/roslyn#5835

@halter73 halter73 merged commit ea6f6b1 into aspnet:dev Nov 4, 2015
@benaadams benaadams deleted the connection-allocs branch November 6, 2015 07:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants