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)
Tue, Jan 27, 8:29 PM
Unknown Object (File)
Sun, Jan 25, 10:04 AM
Unknown Object (File)
Sun, Jan 25, 7:53 AM
Unknown Object (File)
Fri, Jan 23, 11:53 AM
Unknown Object (File)
Dec 20 2025, 7:41 AM
Unknown Object (File)
Nov 26 2025, 5:33 PM
Unknown Object (File)
Nov 24 2025, 2:13 PM
Unknown Object (File)
Nov 24 2025, 12:32 PM
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