mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-23 08:56:47 -05:00
Move the boolean members of `struct source_impl` to the end
of the struct. This changes the size of the struct from
104 bytes to 96 bytes on x86-64.
Before:
struct source_impl {
struct spa_source source; /* 0 48 */
struct impl * impl; /* 48 8 */
struct spa_list link; /* 56 16 */
/* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */
_Bool close; /* 72 1 */
/* XXX 7 bytes hole, try to pack */
union {
spa_source_io_func_t io; /* 80 8 */
spa_source_idle_func_t idle; /* 80 8 */
spa_source_event_func_t event; /* 80 8 */
spa_source_timer_func_t timer; /* 80 8 */
spa_source_signal_func_t signal; /* 80 8 */
} func; /* 80 8 */
_Bool enabled; /* 88 1 */
/* XXX 7 bytes hole, try to pack */
struct spa_source * fallback; /* 96 8 */
/* size: 104, cachelines: 2, members: 7 */
/* sum members: 90, holes: 2, sum holes: 14 */
/* last cacheline: 40 bytes */
};
After:
struct source_impl {
struct spa_source source; /* 0 48 */
struct impl * impl; /* 48 8 */
struct spa_list link; /* 56 16 */
/* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */
union {
spa_source_io_func_t io; /* 72 8 */
spa_source_idle_func_t idle; /* 72 8 */
spa_source_event_func_t event; /* 72 8 */
spa_source_timer_func_t timer; /* 72 8 */
spa_source_signal_func_t signal; /* 72 8 */
} func; /* 72 8 */
struct spa_source * fallback; /* 80 8 */
_Bool close; /* 88 1 */
_Bool enabled; /* 89 1 */
/* size: 96, cachelines: 2, members: 7 */
/* padding: 6 */
/* last cacheline: 32 bytes */
};
|
||
|---|---|---|
| .. | ||
| cpu-arm.c | ||
| cpu-x86.c | ||
| cpu.c | ||
| dbus.c | ||
| evl-plugin.c | ||
| evl-system.c | ||
| journal.c | ||
| log-patterns.c | ||
| log-patterns.h | ||
| logger.c | ||
| loop.c | ||
| meson.build | ||
| node-driver.c | ||
| null-audio-sink.c | ||
| plugin.c | ||
| system.c | ||