Closed Bug 1439362 Opened 2 years ago Closed 2 years ago

make nsBase64Encoder slightly less malloc-happy

Categories

(Core :: Networking, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

nsBase64Encoder::Finish currently works by calling PL_Base64Encode to
allocate a base64-encoded string, then Assign()'ing that to the result
string, another allocation.  mozilla::Base64Encode enables us to base64
encode directly into the result string with a single allocation, saving
an allocation.  (Base64Encode is also slightly more efficient, because
we don't have to do a strlen() on the string being Assign()'d.)  Let's
use Base64Encode instead.
A small improvement, but a nice one.
Attachment #8952122 - Flags: review?(valentin.gosu)
Attachment #8952122 - Flags: review?(valentin.gosu) → review+
Priority: -- → P2
Whiteboard: [necko-triaged]
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/43b8d13b9961
make nsBase64Encoder slightly less malloc-happy; r=valentin
https://hg.mozilla.org/mozilla-central/rev/43b8d13b9961
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.