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:
parent
73ace6acad
commit
28b0adc15f
@ -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];
|
||||
};
|
||||
|
||||
|
@ -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];
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user