Landing Igor's patch for bug 348810, a=beltzner
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@207696 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1098,20 +1098,7 @@ array_sort(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
++newlen;
|
||||
}
|
||||
|
||||
/*
|
||||
* Here len == newlen + undefs + number_of_holes. We want to shrink the
|
||||
* array to relieve the memory pressure from VM in case of many holes.
|
||||
*/
|
||||
if (newlen != len) {
|
||||
vec = JS_realloc(cx, vec, newlen * sizeof vec[0]);
|
||||
if (!vec) {
|
||||
/* realloc that can not shrink. */
|
||||
vec = tvr.u.array;
|
||||
} else {
|
||||
tvr.u.array = vec;
|
||||
}
|
||||
}
|
||||
|
||||
/* Here len == newlen + undefs + number_of_holes. */
|
||||
ca.context = cx;
|
||||
ca.fval = fval;
|
||||
ca.localroot = argv + argc; /* local GC root for temporary string */
|
||||
|
||||
Reference in New Issue
Block a user