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

New Pin type could be used to make BufferBuilder::use_host_slice safe(r)? #139

Open
dmarcuse opened this issue Feb 28, 2019 · 1 comment

Comments

@dmarcuse
Copy link
Contributor

Rust 1.33 was just released, and one of the new features is the Pin<T> type, which prevents a value from being moved in memory. This could be useful when using buffers with the CL_USE_HOST_PTR flag. I think it could even be made 100% safe (on the Rust side of things at least) by also adding a lifetime restriction to the Buffer itself so that the reference is forced to live at least as long as the underlying OpenCL buffer.

@c0gent
Copy link
Member

c0gent commented Mar 1, 2019

Yeah I think you might be right. I'd like to spend some time on this but I might not be able to for a while. I've been waiting for Pin for about two years for some other async related stuff and I might try to do that first (add it to the todo list...).

If you end up playing around with it, let me know what you find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants