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

Consider switching from mmap to memmap #6

Closed
retep998 opened this issue Dec 7, 2015 · 9 comments
Closed

Consider switching from mmap to memmap #6

retep998 opened this issue Dec 7, 2015 · 9 comments

Comments

@retep998
Copy link

retep998 commented Dec 7, 2015

memmap is actually maintained.

https://github.com/danburkert/memmap-rs

@elinorbgr
Copy link
Member

Hmm, yeah indeed. Thanks for pointing this out.

I'll tackle this as soon as I have some time, it should be pretty straightforward.

@elinorbgr
Copy link
Member

Hmm... After some digging, I can't find a way to create a memory-map from a linux file descriptor in memmap-rs, which is exactly the feature I'm using in mmap: https://github.com/vberger/wayland-kbd/blob/master/src/mapped_keyboard.rs#L153-L156

@retep998
Copy link
Author

retep998 commented Dec 9, 2015

@danburkert Nudge, nudge.

@retep998
Copy link
Author

retep998 commented Dec 9, 2015

Wait, you can do this already. On unix platforms you have FromRawFd impl'd on File so you can use that to get a File which you can then pass to memmap.

@danburkert
Copy link
Contributor

Yah the Mmap::open_with_offset function should work. That being said, I've never tested against non-file-backed 'files'.

@elinorbgr
Copy link
Member

Fair point. I'll try this tomorrow.

@frewsxcv
Copy link
Contributor

@vberger Did you ever look into this? Did it end up being non-trivial?

@elinorbgr
Copy link
Member

Hmm, kinda forgot this, sorry for that...

I won't have time to spend on it for the next two weeks unfortunately... :-/

frewsxcv added a commit to frewsxcv/wayland-kbd that referenced this issue Jan 13, 2016
@frewsxcv
Copy link
Contributor

I won't have time to spend on it for the next two weeks unfortunately... :-/

All good!

Opened a PR for this whenever you have time: #9

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

4 participants