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:
mrbkap%gmail.com
2006-08-17 05:19:36 +00:00
parent 45aed199b8
commit bd64c0b6f0

View File

@@ -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 */