0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Fix alignment requirements to include atomic u64.

Not having this led to bus errors on unaligned atomic u64 access
on architectures with 4B pointers.
This commit is contained in:
Maria Matejka 2024-12-11 17:51:46 +01:00
parent 73ace6acad
commit 28b0adc15f
3 changed files with 7 additions and 1 deletions

View File

@ -29,6 +29,7 @@ struct lp_chunk {
struct lp_chunk *next;
struct linpool *lp;
uintptr_t data_align[0];
_Atomic u64 data_align_atomic[0];
byte data[0];
};

View File

@ -373,7 +373,10 @@ tmp_flush(void)
struct mblock {
resource r;
unsigned size;
uintptr_t data_align[0];
union {
uintptr_t bigint;
_Atomic u64 atom;
} _align[0];
byte data[0];
};

View File

@ -171,6 +171,8 @@ struct sl_head {
struct sl_alignment { /* Magic structure for testing of alignment */
byte data;
int x[0];
_Atomic u64 y[0];
void *z[0];
};
#define TLIST_PREFIX sl_head