Page MenuHomeFreeBSD

Use if ... else when printing memory attributes
ClosedPublic

Authored by andrew on Apr 11 2021, 11:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 5:08 AM
Unknown Object (File)
Sun, Oct 12, 5:08 AM
Unknown Object (File)
Sun, Oct 12, 5:08 AM
Unknown Object (File)
Sat, Oct 11, 7:08 PM
Unknown Object (File)
Sat, Oct 11, 6:49 PM
Unknown Object (File)
Jul 28 2025, 11:35 PM
Unknown Object (File)
Jul 7 2025, 10:19 AM
Unknown Object (File)
Jul 6 2025, 7:01 AM
Subscribers

Details

Summary

In vmstat there is a switch statement that converts these attributes to
a string. As some values can be duplicate we have to hide these from
userspace.

Replace this switch statement with an if ... else macro that lets us
repeat values without a compiler error.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable