Closed Bug 530366 Opened 12 years ago Closed 12 years ago

don't use std::sort in jsregexp

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: luke, Assigned: luke)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Per a moz.dev.platform discussion, we cannot rely on libstdc++ for Android.  There aren't many uses; one of the few is using std::sort in jsregexp.cpp.  Also, I just noticed std::sort doesn't specify throw(), so its out on two counts.  The sort is used for tiny (bounded maximum size) arrays, so a barebones replacement will do fine.
You could also probably use js_MergeSort.
I had hoped I would find something to reuse :)
Attachment #414129 - Flags: review?
Attachment #414129 - Flags: review? → review?(dmandelin)
Comment on attachment 414129 [details] [diff] [review]
use js_MergeSort instead

Seems good, except that I think you can replace

    *result = ca < cb ? -1 : (ca > cb ? 1 : 0);

with 

    *result = ca - cb;
Attachment #414129 - Flags: review?(dmandelin) → review+
(In reply to comment #4)
D'oh!
http://hg.mozilla.org/tracemonkey/rev/a34ee79b0c62
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/a34ee79b0c62
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.