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

Platform: add totalRAM. #1840

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

saurtron
Copy link
Collaborator

@saurtron saurtron commented Dec 20, 2024

Work done

  • Add Platform.totalRAM to get total system ram as a number in MB.

Related issues

  • Fixes Add Platform.AvailableRAM #1640
    • not the same name but imo AvailableRAM or FreeRAM should be reserved for smth else reporting actual free ram, that seems a bit trickier tho and possibly not so useful because the number could be misleading, so for now just adding TotalRAM.

Remarks

  • I see games having to parse the hardware string, that seems awkward and fragile.
  • Not sure if I'm using the best approach here, _SC_PHYS_PAGES is not POSIX standard, but I hope it won't be a problem. It does seem to be supported in freebsd as well as linux.

@sprunk
Copy link
Collaborator

sprunk commented Dec 20, 2024

Fixes #1640

@saurtron saurtron added Lua API candidate PRs that should be good to go or important for next release labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
candidate PRs that should be good to go or important for next release Lua API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Platform.AvailableRAM
2 participants