ICU-20001 Adding alignas to static-allocated memory.

Should fix possible crashes on ARM platforms. (#63)
This commit is contained in:
Shane 2018-08-15 21:01:10 -05:00 committed by Shane Carr
parent da7bd533ab
commit 3420d5a55b
No known key found for this signature in database
GPG key ID: FCED3B24AAB18B5C
2 changed files with 2 additions and 0 deletions

View file

@ -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.

View file

@ -15,6 +15,7 @@ using namespace icu::number::impl;
namespace {
alignas(DecimalFormatProperties)
char kRawDefaultProperties[sizeof(DecimalFormatProperties)];
icu::UInitOnce gDefaultPropertiesInitOnce = U_INITONCE_INITIALIZER;