diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2014-03-15 19:21:14 +0200 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2014-03-28 23:06:16 -0400 |
commit | 67b397e09aef74768ee58b354d5abed75a8d4557 (patch) | |
tree | 91fa7f9a1149caa167fca600044418a8c1d53d30 /src | |
parent | 3a501858147d9d31573f24d1b352fbeb52d7c3f2 (diff) |
Migrate to using musl 0.9.13 libc qsort for better asm.js performance.
Diffstat (limited to 'src')
-rw-r--r-- | src/library.js | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/library.js b/src/library.js index ebfac476..dcaf2370 100644 --- a/src/library.js +++ b/src/library.js @@ -3238,30 +3238,6 @@ LibraryManager.library = { return _strtoull(str, endptr, base); // no locale support yet }, - qsort__deps: ['malloc', 'memcpy', 'free'], - qsort: function(base, num, size, cmp) { - if (num == 0 || size == 0) return; - // forward calls to the JavaScript sort method - // first, sort the items logically - var keys = []; - for (var i = 0; i < num; i++) keys.push(i); - keys.sort(function(a, b) { -#if ASM_JS - return Module['dynCall_iii'](cmp, base+a*size, base+b*size); -#else - return FUNCTION_TABLE[cmp](base+a*size, base+b*size); -#endif - }); - // apply the sort - var temp = _malloc(num*size); - _memcpy(temp, base, num*size); - for (var i = 0; i < num; i++) { - if (keys[i] == i) continue; // already in place - _memcpy(base+i*size, temp+keys[i]*size, size); - } - _free(temp); - }, - environ: 'allocate(1, "i32*", ALLOC_STATIC)', __environ__deps: ['environ'], __environ: '_environ', |