refactor(uucore): integrate procfs for Linux memory parsing#8951
refactor(uucore): integrate procfs for Linux memory parsing#8951sylvestre merged 3 commits intouutils:mainfrom
Conversation
|
GNU testsuite comparison: |
|
EDIT: Seems you already discussed this with Sylvestre, so I'll shut up :). However, I'd prefer if you took a peak at how they do it, implemented it in that way (or similarly, such that we get what we're after) and then credit them properly in a copyright comment. I still have strong feelings about adding a crate of thousands of LOC for a parser of 20 lines :/ |
|
GNU testsuite comparison: |
|
@Alonely0 this ship has sailed a long time ago :) |
I'd love to get more acquainted on uutils' policy on dependencies and how it has come to be :) |
|
it isn't complex : i am lazy! :) More seriously, one of the reason why I think Rust is successful is cargo and its ecosystem! Using crate, even for "simple" things like this one allows better cross collaboration, you don't have to reinvent the wheel and you benefit from the future evolution of the crate almost of free. |
Summary
procfsdependency to query/proc/meminfovia safe APIsprocfs::Meminfoto compute total and available memory bytes for uucore parsersparse_size_non_zero_u64so callers can reject zero-sized inputs consistentlyTesting