-
-
Notifications
You must be signed in to change notification settings - Fork 758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICU-20046 Fix some OOM issues in the RBNF class. #24
Conversation
…of-memory (OOM) failures.
@@ -1133,8 +1133,17 @@ RuleBasedNumberFormat::format(const DecimalQuantity &number, | |||
|
|||
// TODO this section should probably be optimized. The DecimalFormat is shared in ICU4J. | |||
NumberFormat *decimalFormat = NumberFormat::createInstance(locale, UNUM_DECIMAL, status); | |||
if (decimalFormat == nullptr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be cleaner to use LocalPointer<NumberFormat> decimialFormat(...
It gets rid of the delete decimalformat;
lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look at the changes Andy! :)
I've pushed a new commit that uses LocalPointer
instead, which cleans up the manual delete lines.
@@ -1166,8 +1175,17 @@ RuleBasedNumberFormat::format(const DecimalQuantity &number, | |||
|
|||
// TODO this section should probably be optimized. The DecimalFormat is shared in ICU4J. | |||
NumberFormat *decimalFormat = NumberFormat::createInstance(locale, UNUM_DECIMAL, status); | |||
if (decimalFormat == nullptr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, LocalPointer<NumberFormat>
would be simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Andy! This should be resolved in the latest commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. LocalPointer could simplify a bit by getting rid of some explicit deletes.
Setting Andy as the primary reviewer (aka assignee), since he has already provided great feedback and commented LGTM. (Though GitHub doesn't consider a comment the same as an actual review.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- There are a few locations in the RBNF class that don't check for out-of-memory (OOM) failures. - Using LocalPointer to clean up the manual deletes. - Change to use nullptr instead of NULL. - A few minor typo fixes as well.
- There are a few locations in the RBNF class that don't check for out-of-memory (OOM) failures. - Using LocalPointer to clean up the manual deletes. - Change to use nullptr instead of NULL. - A few minor typo fixes as well.
- There are a few locations in the RBNF class that don't check for out-of-memory (OOM) failures. - Using LocalPointer to clean up the manual deletes. - Change to use nullptr instead of NULL. - A few minor typo fixes as well.
- There are a few locations in the RBNF class that don't check for out-of-memory (OOM) failures. - Using LocalPointer to clean up the manual deletes. - Change to use nullptr instead of NULL. - A few minor typo fixes as well.
- There are a few locations in the RBNF class that don't check for out-of-memory (OOM) failures. - Using LocalPointer to clean up the manual deletes. - Change to use nullptr instead of NULL. - A few minor typo fixes as well.
- There are a few locations in the RBNF class that don't check for out-of-memory (OOM) failures. - Using LocalPointer to clean up the manual deletes. - Change to use nullptr instead of NULL. - A few minor typo fixes as well.
Units router younies
It turns out that Nuget.org won't accept any packages that start with a `runtime*` prefix. So we'll need to move the Runtime ID (RID) to the end of the Nuget package name for the dependent runtime packages instead. This change also bumps the version number, as Nuget.org won't let you re-submit any package with the same version once it has been removed/deleted.
There are a few locations in the RuleBasedNumberFormat class that don't check for out-of-memory (OOM) failures.