darfink / region-rs

A cross-platform virtual memory API written in Rust
https://darfink.github.io/region-rs/
MIT License
119 stars 23 forks source link

Region enumeration on linux & windows #10

Closed CertainLach closed 1 year ago

CertainLach commented 4 years ago

Currenly has dependence on git repo, as long as https://github.com/tinaun/gen-iter/pull/3 isn't merged

Also requires nightly for generators

darfink commented 4 years ago

Sorry for leaving you without any input.

This is definitely an interesting addition once generators are stabilised. I'm a bit torn between keeping the library simple yet providing functionality for operations that are frequent.

Functionality similar to this, is something that I already utilise in detour-rs, but it's not as straight forward when it's not integrated directly into the region library, so this may be an apt addition.

darfink commented 4 years ago

I've refactored the internal query implementation to use iterators instead, greatly inspired by this branch. I've merged it in master, but I've yet to release it.

I've implemented it for all OSs, and Windows/Linux excerpts can be seen here: https://github.com/darfink/region-rs/blob/02a1d48164efe9eb18adec1362fde6d72a55885a/src/os/linux.rs#L7-L26

https://github.com/darfink/region-rs/blob/02a1d48164efe9eb18adec1362fde6d72a55885a/src/os/windows.rs#L11-L55

morrisonlevi commented 1 year ago

I think we can close this now, right?

CertainLach commented 1 year ago

Yep, this is already implemented.