4 ms·
1. Finding the size of a struct member (lifted from the Linux kernel) #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 2. Not strictly C: using `pahole` to ana
by donquichotte 6y ago
1. Finding the size of a struct member (lifted from the Linux kernel)
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
2. Not strictly C: using `pahole` to analyze how structs are laid out in memory
https://linux.die.net/man/1/pahole https://linux.die.net/man/1/pahole
- SV_BubbleTime 6y agoLast week I would have said “ok, but I’ll never need to do that”. This week I had to do exactly that (find the size of a struct member).