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

refactor memory.cpp #1514

Merged
merged 2 commits into from
Jan 8, 2025
Merged

Conversation

17314642
Copy link
Contributor

looks a lot cleaner now and start using MemTotal - MemAvailable since everyone but htop use this now

unsigned long long bufmem, buffers, cached;
};

struct process_mem
Copy link
Owner

Choose a reason for hiding this comment

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

Why couldn't we still have a struct for this?

Copy link
Contributor Author

@17314642 17314642 Jan 7, 2025

Choose a reason for hiding this comment

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

I was initially confused as to why process memory had a struct, but not ram (memused, memmax, swapused variables) and just decided to delete it for consistency.

But if we there to create a struct, I think it should be one struct containing info about both types of memory. Like this:

struct memory_stats {
    float memused, memmax, swapused;
    uint64_t proc_resident, proc_virt, proc_shared;
}

Just to make it easily understandable that both those stats come from the same place.

@17314642
Copy link
Contributor Author

17314642 commented Jan 8, 2025

Rebased and added gamescope support for proc_mem and io_read/write

@flightlessmango flightlessmango merged commit 0575c8e into flightlessmango:master Jan 8, 2025
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants