Skip to content

free: fix humanization#431

Merged
Krysztal112233 merged 1 commit into
uutils:mainfrom
Bluemangoo:feature/free-human
Jun 7, 2025
Merged

free: fix humanization#431
Krysztal112233 merged 1 commit into
uutils:mainfrom
Bluemangoo:feature/free-human

Conversation

@Bluemangoo

@Bluemangoo Bluemangoo commented Jun 6, 2025

Copy link
Copy Markdown
Collaborator
$ cargo run -q free -h && free -h && free
               total        used        free      shared  buff/cache   available
Mem:            29Gi        13Gi       2.2Gi       2.4Gi        15Gi        15Gi
Swap:           22Gi          0B        22Gi
               total        used        free      shared  buff/cache   available
Mem:            29Gi        13Gi       2.2Gi       2.4Gi        15Gi        15Gi
Swap:           22Gi          0B        22Gi
               total        used        free      shared  buff/cache   available
Mem:        30517772    14584340     2340712     2487436    16534996    15933432
Swap:       23437308           0    23437308

tips: this is what procps actually doing, weird

10138 * 1024 B -> "9.9Mi"
10230 * 1024 B -> "9Mi"

plus, humanization of procps differs from coreutils'. coreutils' use ceil.

@Krysztal112233

Copy link
Copy Markdown
Collaborator

looks great :)

Comment thread src/uu/free/src/free.rs
@Bluemangoo Bluemangoo force-pushed the feature/free-human branch from da9ee95 to bf69bef Compare June 7, 2025 09:19
@Krysztal112233 Krysztal112233 merged commit 3a665eb into uutils:main Jun 7, 2025
13 checks passed
@codecov

codecov Bot commented Jun 7, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (f3860a7) to head (bf69bef).
Report is 5 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #431   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Bluemangoo Bluemangoo deleted the feature/free-human branch July 13, 2025 07:50
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.

free: implement --human

2 participants