mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Align bins_space_ storage (#17552)
Otherwise, `new (BinFromIndex(b)) Bin(this, bin_size);` in bfc_arena.cc would cause a -fsanitize=alignment (part of -fsanitize=undefined) failure like runtime error: constructor call on misaligned address 0xXXX for type 'Bin', which requires 8 byte alignment
This commit is contained in:
parent
1182b5509b
commit
d00adb7989
1 changed files with 1 additions and 1 deletions
|
|
@ -482,7 +482,7 @@ class BFCArena : public IAllocator {
|
|||
|
||||
Bin* BinForSize(size_t bytes) { return BinFromIndex(BinNumForSize(bytes)); }
|
||||
|
||||
char bins_space_[sizeof(Bin) * kNumBins];
|
||||
alignas(Bin) char bins_space_[sizeof(Bin) * kNumBins];
|
||||
|
||||
// The size of the current region allocation.
|
||||
SafeInt<size_t> curr_region_allocation_bytes_;
|
||||
|
|
|
|||
Loading…
Reference in a new issue