mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-06 22:15:31 +00:00
ICU-20001 Adding alignas to static-allocated memory.
Should fix possible crashes on ARM platforms. (#63)
This commit is contained in:
parent
da7bd533ab
commit
3420d5a55b
2 changed files with 2 additions and 0 deletions
|
@ -27,6 +27,7 @@ UnicodeSet* gUnicodeSets[COUNT] = {};
|
|||
|
||||
// Save the empty instance in static memory to have well-defined behavior if a
|
||||
// regular UnicodeSet cannot be allocated.
|
||||
alignas(UnicodeSet)
|
||||
char gEmptyUnicodeSet[sizeof(UnicodeSet)];
|
||||
|
||||
// Whether the gEmptyUnicodeSet is initialized and ready to use.
|
||||
|
|
|
@ -15,6 +15,7 @@ using namespace icu::number::impl;
|
|||
|
||||
namespace {
|
||||
|
||||
alignas(DecimalFormatProperties)
|
||||
char kRawDefaultProperties[sizeof(DecimalFormatProperties)];
|
||||
|
||||
icu::UInitOnce gDefaultPropertiesInitOnce = U_INITONCE_INITIALIZER;
|
||||
|
|
Loading…
Add table
Reference in a new issue