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

better DispatchData support #732

Merged
merged 1 commit into from Jan 3, 2019

Conversation

Projects
None yet
2 participants
@weissi
Copy link
Contributor

weissi commented Jan 3, 2019

better DispatchData support
Motivation:

DispatchData's APIs are less than optimal and the current one we used
did allocate at least on Linux to copy bytes out.

Modifications:

introduce ByteBuffer.write/read/set/getDispatchData

Result:

when Dispatch gets fixed, lower allocations

@weissi weissi requested a review from Lukasa Jan 3, 2019

public func getDispatchData(at index: Int, length: Int) -> DispatchData? {
precondition(index >= 0, "index must not be negative")
precondition(length >= 0, "length must not be negative")
return withVeryUnsafeBytes { pointer in

This comment has been minimized.

@Lukasa

Lukasa Jan 3, 2019

Contributor

Nit: explicit self.

Show resolved Hide resolved Sources/NIO/ByteBuffer-aux.swift

@weissi weissi force-pushed the weissi:jw-better-dispatch-data-support branch from 8fe45f2 to 1bf9955 Jan 3, 2019

@weissi weissi added this to the 2.0.0 milestone Jan 3, 2019

better DispatchData support
Motivation:

DispatchData's APIs are less than optimal and the current one we used
did allocate at least on Linux to copy bytes out.

Modifications:

introduce ByteBuffer.write/read/set/getDispatchData

Result:

when Dispatch gets fixed, lower allocations

@weissi weissi force-pushed the weissi:jw-better-dispatch-data-support branch from 1bf9955 to 029b009 Jan 3, 2019

@Lukasa

Lukasa approved these changes Jan 3, 2019

Copy link
Contributor

Lukasa left a comment

LGTM.

@Lukasa Lukasa merged commit 08eb325 into apple:master Jan 3, 2019

1 check passed

pull request validation (5.0) Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment