Closed Bug 1482093 Opened 6 years ago Closed 6 years ago

Make conversions from UTF-16 and Latin1 to UTF-8 utilize the slop in the first ASCII-sized allocation

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: hsivonen, Assigned: hsivonen)

References

Details

Attachments

(1 file)

After bug 1402247  and bug 1473337, if the code for converting to UTF-8 first guesses that the string contains ASCII, it tries to handle only ASCII first and reallocates if there is any non-ASCII. This happens even if the initial allocation had enough slop from rounding up to the nearest jemalloc bucket that a few non-ASCII codepoints would fit without reallocation.

This bug is about making use of that available space.
Depends on: 1482095
Comment on attachment 8998837 [details]
Bug 1482093 - Make conversions from UTF-16 and Latin1 to UTF-8 utilize the slop in the first ASCII-sized allocation.

:Nika Layzell (PTO/OOT -> Aug. 20) has approved the revision.
Attachment #8998837 - Flags: review+
Pushed by hsivonen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e35c67de74b1
Make conversions from UTF-16 and Latin1 to UTF-8 utilize the slop in the first ASCII-sized allocation. r=nika
https://hg.mozilla.org/mozilla-central/rev/e35c67de74b1
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: