diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2025-08-06 14:42:06 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2025-08-06 14:42:06 +0200 |
| commit | 0b05a4e71e181fa47c319546fc9ad9fb1b3f6f24 (patch) | |
| tree | b19794218bb90288e60529f0de4493492ed426a4 /include | |
| parent | 47d27cdaff8e07783683a076359dd975b822bc86 (diff) | |
| download | busybox-w32-0b05a4e71e181fa47c319546fc9ad9fb1b3f6f24.tar.gz busybox-w32-0b05a4e71e181fa47c319546fc9ad9fb1b3f6f24.tar.bz2 busybox-w32-0b05a4e71e181fa47c319546fc9ad9fb1b3f6f24.zip | |
top,pmap: speed up /smaps parsing
function old new delta
procps_read_smaps 515 529 +14
procps_get_maps 685 665 -20
.rodata 105847 105820 -27
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 14/-47) Total: -33 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/platform.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/platform.h b/include/platform.h index e10c5b558..a5b61757f 100644 --- a/include/platform.h +++ b/include/platform.h | |||
| @@ -209,6 +209,8 @@ | |||
| 209 | # define SWAP_LE64(x) bb_bswap_64(x) | 209 | # define SWAP_LE64(x) bb_bswap_64(x) |
| 210 | # define IF_BIG_ENDIAN(...) __VA_ARGS__ | 210 | # define IF_BIG_ENDIAN(...) __VA_ARGS__ |
| 211 | # define IF_LITTLE_ENDIAN(...) | 211 | # define IF_LITTLE_ENDIAN(...) |
| 212 | /* How do bytes a,b,c,d (sequential in memory) look if fetched into uint32_t? */ | ||
| 213 | # define PACK32_BYTES(a,b,c,d) (uint32_t)((d)+((c)<<8)+((b)<<16)+((a)<<24)) | ||
| 212 | #else | 214 | #else |
| 213 | # define SWAP_BE16(x) bswap_16(x) | 215 | # define SWAP_BE16(x) bswap_16(x) |
| 214 | # define SWAP_BE32(x) bswap_32(x) | 216 | # define SWAP_BE32(x) bswap_32(x) |
| @@ -218,6 +220,7 @@ | |||
| 218 | # define SWAP_LE64(x) (x) | 220 | # define SWAP_LE64(x) (x) |
| 219 | # define IF_BIG_ENDIAN(...) | 221 | # define IF_BIG_ENDIAN(...) |
| 220 | # define IF_LITTLE_ENDIAN(...) __VA_ARGS__ | 222 | # define IF_LITTLE_ENDIAN(...) __VA_ARGS__ |
| 223 | # define PACK32_BYTES(a,b,c,d) (uint32_t)((a)+((b)<<8)+((c)<<16)+((d)<<24)) | ||
| 221 | #endif | 224 | #endif |
| 222 | 225 | ||
| 223 | 226 | ||
