#size #command-line #linux #libc #struct

app size-rs

Tells the size of some structures available on the system

1 unstable release

0.1.0 Oct 16, 2023

#2161 in Command line utilities

Download history 9/week @ 2024-02-18 10/week @ 2024-02-25 59/week @ 2024-03-10 2/week @ 2024-03-17 13/week @ 2024-03-31

74 downloads per month

GPL-3.0-or-later

16KB
55 lines

size-rs will give you the size in memory that some rust and libc structures takes on your system. May only work on Linux systems:

$ size-rs

Integer sizes:
        u8: 1 byte - 8 bits
        u16: 2 bytes - 16 bits
        u32: 4 bytes - 32 bits
        u64: 8 bytes - 64 bits
        u128: 16 bytes - 128 bits

Ids types:
        pid_t: 4 bytes - 32 bits
        uid_t: 4 bytes - 32 bits
        gid_t: 4 bytes - 32 bits
        id_t: 4 bytes - 32 bits

Files related sizes:
        ino_t: 8 bytes - 64 bits
        off_t: 8 bytes - 64 bits
        loff_t: 8 bytes - 64 bits
        dev_t: 8 bytes - 64 bits
        dirent: 280 bytes - 2240 bits
        ino64_t: 8 bytes - 64 bits
        off64_t: 8 bytes - 64 bits
        dirent64: 280 bytes - 2240 bits

Length sizes:
        size_t: 8 bytes - 64 bits
        ssize_t: 8 bytes - 64 bits

Dependencies

~1.3–1.9MB
~36K SLoC