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

Macos processes #118

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Conversation

emanuele-em
Copy link
Member

@emanuele-em emanuele-em commented Oct 25, 2023

This is a first draft to get first info from running processes:

there are a lot of steps before the png image (NSImage -> tif_representation -> bitmap_representation -> png_representation), maybe we can optimize that part

@emanuele-em emanuele-em marked this pull request as ready for review November 2, 2023 17:58
Copy link
Member

@mhils mhils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! 🚀
Fantastic to see that enumeration now works without instantiating all those NSRunningApplications, great job. 🎉

src/processes.rs Outdated Show resolved Hide resolved
src/macos/icons.rs Show resolved Hide resolved
src/macos/icons.rs Show resolved Hide resolved
src/macos/processes.rs Show resolved Hide resolved
Copy link
Member

@mhils mhils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good now! Few smaller comments inline below.

The final thing I'm worried about here is memory leaks in the unsafe code. I suppose this is not super easy to test though. At the very least, can we maybe have some (#[ignore]d by default) test cases that call the unsafe methods (e.g. tif_data_for_executable) in a loop so that one can manually check for an increase in memory? Does that make sense? Smarter ideas are welcome as well of course, but I don't want to overcomplicate things.

src/macos/processes.rs Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
benches/process.rs Outdated Show resolved Hide resolved
src/macos/icons.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants