Fix ARMv5 atomic loads from Boost dummy storage

This commit is contained in:
Antonio SJ Musumeci 2026-11-14 18:19:46 -06:00 • committed by trapexit
parent ecb4de5bc0
commit 6d138906ec
3 changed files with 18 additions and 3 deletions

View file

@ -949,13 +949,14 @@ Group* dummy_groups()
* we are not allocating any dynamic memory and yet lookup can be implemented
* without checking for groups==nullptr. This space won't ever be used for
* insertion as the container's capacity is precisely zero.
* Keep the storage writable: atomic loads on ARMv5 can write back through
* compare-and-swap. constinit preserves static initialization without const.
*/
static constexpr typename Group::dummy_group_type
static constinit typename Group::dummy_group_type
storage[Size]={typename Group::dummy_group_type(),};
return reinterpret_cast<Group*>(
const_cast<typename Group::dummy_group_type*>(storage));
return reinterpret_cast<Group*>(storage);
}
template<