make nsBase64Encoder slightly less malloc-happy

RESOLVED FIXED in Firefox 60

Status

()

enhancement
P2
normal
RESOLVED FIXED
Last year
Last year

People

(Reporter: froydnj, Assigned: froydnj)

Tracking

unspecified
mozilla60
Points:
---

Firefox Tracking Flags

(firefox60 fixed)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 attachment)

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: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.