Closed
Bug 72196
Opened 23 years ago
Closed 15 years ago
eliminate |NS_QuickSort|, use C's standard |qsort| instead
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: mkaply, Unassigned)
References
Details
Attachments
(1 file)
8.99 KB,
patch
|
Details | Diff | Splinter Review |
NS_QuickSort is currently implemented in xpcom/ds. I don't think this is the right place for it. Here is my best explanation of logic for this. NS_QuickSort requires that a function be passed into it. This function needs a calling convention set. The only two places in Mozilla where we really have the ability to specify calling conventions are NSPR and JS. Currently, NS_QuickSort uses PR_EXTERN, but this is not correct, as there is no guarantee that NSPR and XPCOM will be compiled using the same calling convention. NSPR could even be compiled with a different compiler. so NS_QuickSort should either have its own calling convention created like NS_QS_EXTERN and NS_QS_CALLBACK, or it should be moved. So NS_QuickSort needs to be in a place that allows calling convention to be set on the compilation of it, as well as the header and calling of it. My personal suggestion would be NSPR, and I am attaching a diff for that.
Reporter | ||
Comment 1•23 years ago
|
||
i'd recommend waiting until after NS_QuickSort drops off the topcrash reports :-(
Depends on: 80643
Comment 3•23 years ago
|
||
Mozilla should consider removing NS_QuickSort and just use qsort in the standard C library. The comments in the source file: /* We need this because Solaris' version of qsort is broken and * causes array bounds reads. */ turned out to be wrong -- we were calling qsort with an incorrect comparison function which only broke the Solaris implementation of qsort.
Updated•22 years ago
|
Summary: NS_QuickSort does not really belong in XPCOM → eliminate |NS_QuickSort|, use C's standard |qsort| instead
Reporter | ||
Comment 4•21 years ago
|
||
Should we look at creating a patch for this?
qsort doesn't provide a transparent |void* data| parameter that gets passed on to the compare-function. At least transformiix uses this, possibly others too.
Updated•18 years ago
|
QA Contact: kandrot → nobody
Updated•18 years ago
|
Assignee: scc → nobody
QA Contact: nobody → xpcom
Updated•15 years ago
|
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•