This is an archive of the discontinued Mercurial Phabricator instance.

util: provide a helper function to estimate RAM size
ClosedPublic

Authored by joerg.sonnenberger on Jun 21 2020, 6:40 PM.

Details

Summary

For POSIX systems, it uses sysconf. For Windows, it uses the win32 API
directly.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

This currently triggers a warning about using ui in util, so consider this a RFC for dealing with that.

pulkit added a subscriber: pulkit.Jul 7 2020, 2:08 PM
pulkit added inline comments.
mercurial/ui.py
2125

nit: can fail by returning None -> if we fails to calculate the memory, None is returned.

mercurial/util.py
3607

Can we move this try-expect in a if not windows: and also some comments on errors caught as why they are caught?

pulkit accepted this revision.Jul 10 2020, 6:02 AM
This revision is now accepted and ready to land.Jul 10 2020, 6:02 AM