Skip to content
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

AioCb should work with refcounted buffers #575

Closed
asomers opened this issue Apr 14, 2017 · 0 comments
Closed

AioCb should work with refcounted buffers #575

asomers opened this issue Apr 14, 2017 · 0 comments
Assignees

Comments

@asomers
Copy link
Member

asomers commented Apr 14, 2017

The AioCb structure contains a reference (actually just a PhantomData) to a slice. This makes it impossible to use in situations where the borrow checker can't prove that the slice will outlive the AioCb, such as with Tokio. There should be a way to create AioCbs that use reference counted buffers instead.

@asomers asomers self-assigned this Apr 14, 2017
asomers added a commit to asomers/nix that referenced this issue Apr 14, 2017
The existing AioCb constructors work for simple programs where
everything is stored on the stack.  But in more complicated programs the
borrow checker can't prove that a buffer will outlive the AioCb that
references it.  Fix this problem by introducting
AioCb::from_boxed_slice, which takes a reference-counted buffer.

Fixes nix-rust#575
asomers added a commit to asomers/nix that referenced this issue Apr 15, 2017
The existing AioCb constructors work for simple programs where
everything is stored on the stack.  But in more complicated programs the
borrow checker can't prove that a buffer will outlive the AioCb that
references it.  Fix this problem by introducting
AioCb::from_boxed_slice, which takes a reference-counted buffer.

Fixes nix-rust#575
asomers added a commit to asomers/nix that referenced this issue Apr 15, 2017
The existing AioCb constructors work for simple programs where
everything is stored on the stack.  But in more complicated programs the
borrow checker can't prove that a buffer will outlive the AioCb that
references it.  Fix this problem by introducting
AioCb::from_boxed_slice, which takes a reference-counted buffer.

Fixes nix-rust#575
asomers added a commit to asomers/nix that referenced this issue Apr 16, 2017
The existing AioCb constructors work for simple programs where
everything is stored on the stack.  But in more complicated programs the
borrow checker can't prove that a buffer will outlive the AioCb that
references it.  Fix this problem by introducting
AioCb::from_boxed_slice, which takes a reference-counted buffer.

Fixes nix-rust#575
asomers added a commit to asomers/nix that referenced this issue Apr 16, 2017
The existing AioCb constructors work for simple programs where
everything is stored on the stack.  But in more complicated programs the
borrow checker can't prove that a buffer will outlive the AioCb that
references it.  Fix this problem by introducting
AioCb::from_boxed_slice, which takes a reference-counted buffer.

Fixes nix-rust#575
bors bot added a commit that referenced this issue Apr 16, 2017
582: Add AioCb::from_boxed_slice r=posborne
The existing AioCb constructors work for simple programs where
everything is stored on the stack.  But in more complicated programs the
borrow checker can't prove that a buffer will outlive the AioCb that
references it.  Fix this problem by introducting
AioCb::from_boxed_slice, which takes a reference-counted buffer.

Fixes #575
@bors bors bot closed this as completed in #582 Apr 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant