diff options
author | Ujjwal Sharma <usharma1998@gmail.com> | 2019-04-23 15:35:49 +0530 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2019-04-25 21:37:14 +0200 |
commit | c9b298c5eed7abec0aff02d1f67e18e5ea938fc9 (patch) | |
tree | d523c26552e0c06e0c7e17434d2b68bed2b6e9e8 /deps/icu-small/source/i18n/dtfmtsym.cpp | |
parent | 6bbb9ebf8d8da927fc71f648af4739f2d574014f (diff) | |
download | node-new-c9b298c5eed7abec0aff02d1f67e18e5ea938fc9.tar.gz |
deps: update ICU to 64.2
Update the version of the bundled ICU (deps/icu-small) to ICU version
64.2 (Unicode 12, CLDR 35)
Fixes: https://github.com/nodejs/node/issues/26388
PR-URL: https://github.com/nodejs/node/pull/27361
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'deps/icu-small/source/i18n/dtfmtsym.cpp')
-rw-r--r-- | deps/icu-small/source/i18n/dtfmtsym.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/deps/icu-small/source/i18n/dtfmtsym.cpp b/deps/icu-small/source/i18n/dtfmtsym.cpp index c9dfa04583..04aa01eb4c 100644 --- a/deps/icu-small/source/i18n/dtfmtsym.cpp +++ b/deps/icu-small/source/i18n/dtfmtsym.cpp @@ -21,6 +21,9 @@ * 10/12/05 emmons Added setters for eraNames, month/day by width/context ******************************************************************************* */ + +#include <utility> + #include "unicode/utypes.h" #if !UCONFIG_NO_FORMATTING @@ -232,8 +235,6 @@ static const char gDayPeriodTag[]="dayPeriod"; static const char gContextTransformsTag[]="contextTransforms"; -static UMutex LOCK = U_MUTEX_INITIALIZER; - /** * Jitterbug 2974: MSVC has a bug whereby new X[0] behaves badly. * Work around this. @@ -1245,6 +1246,7 @@ const UnicodeString** DateFormatSymbols::getZoneStrings(int32_t& rowCount, int32_t& columnCount) const { const UnicodeString **result = NULL; + static UMutex LOCK = U_MUTEX_INITIALIZER; umtx_lock(&LOCK); if (fZoneStrings == NULL) { @@ -1500,7 +1502,7 @@ struct CalendarDataSink : public ResourceSink { * To avoid double deletion, 'maps' won't take ownership of the objects. Instead, * 'mapRefs' will own them and will delete them when CalendarDataSink is deleted. */ - UVector mapRefs; + MemoryPool<Hashtable> mapRefs; // Paths and the aliases they point to UVector aliasPathPairs; @@ -1518,7 +1520,7 @@ struct CalendarDataSink : public ResourceSink { // Initializes CalendarDataSink with default values CalendarDataSink(UErrorCode& status) : arrays(FALSE, status), arraySizes(FALSE, status), maps(FALSE, status), - mapRefs(deleteHashtable, NULL, 10, status), + mapRefs(), aliasPathPairs(uprv_deleteUObject, uhash_compareUnicodeString, status), currentCalendarType(), nextCalendarType(), resourcesToVisit(NULL), aliasRelativePath() { @@ -1663,7 +1665,7 @@ struct CalendarDataSink : public ResourceSink { // Set the resources to visit on the next calendar if (!resourcesToVisitNext.isNull()) { - resourcesToVisit.moveFrom(resourcesToVisitNext); + resourcesToVisit = std::move(resourcesToVisitNext); } } @@ -1688,14 +1690,14 @@ struct CalendarDataSink : public ResourceSink { if (value.getType() == URES_STRING) { // We are on a leaf, store the map elements into the stringMap if (i == 0) { - LocalPointer<Hashtable> stringMapPtr(new Hashtable(FALSE, errorCode), errorCode); - stringMap = stringMapPtr.getAlias(); + // mapRefs will keep ownership of 'stringMap': + stringMap = mapRefs.create(FALSE, errorCode); + if (stringMap == NULL) { + errorCode = U_MEMORY_ALLOCATION_ERROR; + return; + } maps.put(path, stringMap, errorCode); - // mapRefs will take ownership of 'stringMap': - mapRefs.addElement(stringMap, errorCode); if (U_FAILURE(errorCode)) { return; } - // Only release ownership after mapRefs takes it (no error happened): - stringMapPtr.orphan(); stringMap->setValueDeleter(uprv_deleteUObject); } U_ASSERT(stringMap != NULL); @@ -1839,11 +1841,6 @@ struct CalendarDataSink : public ResourceSink { static void U_CALLCONV deleteUnicodeStringArray(void *uArray) { delete[] static_cast<UnicodeString *>(uArray); } - - // Deleter function to be used by 'maps' - static void U_CALLCONV deleteHashtable(void *table) { - delete static_cast<Hashtable *>(table); - } }; // Virtual destructors have to be defined out of line CalendarDataSink::~CalendarDataSink() { |