aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2014-03-15 18:41:36 +0200
committerJukka Jylänki <jujjyl@gmail.com>2014-03-28 23:06:16 -0400
commit58f9620df20ab6a9bf35c7c91075ecd81597b411 (patch)
treec3a97f61a720386d90fab1fe90e3ba2320684b5c /src
parentcde38c81c2330c139fa5d7d12a9e3688c5059f9c (diff)
Migrate to using musl 0.9.13 libc bsearch to take advantage of compiled asm.js performance in the algorithm.
Diffstat (limited to 'src')
-rw-r--r--src/library.js28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/library.js b/src/library.js
index 881fa54b..2ff395c4 100644
--- a/src/library.js
+++ b/src/library.js
@@ -3035,34 +3035,6 @@ LibraryManager.library = {
Module['abort']();
},
- bsearch: function(key, base, num, size, compar) {
- function cmp(x, y) {
-#if ASM_JS
- return Module['dynCall_iii'](compar, x, y);
-#else
- return FUNCTION_TABLE[compar](x, y);
-#endif
- };
- var left = 0;
- var right = num;
- var mid, test, addr;
-
- while (left < right) {
- mid = (left + right) >>> 1;
- addr = base + (mid * size);
- test = cmp(key, addr);
- if (test < 0) {
- right = mid;
- } else if (test > 0) {
- left = mid + 1;
- } else {
- return addr;
- }
- }
-
- return 0;
- },
-
realloc__deps: ['malloc', 'memcpy', 'free'],
realloc: function(ptr, size) {
// Very simple, inefficient implementation - if you use a real malloc, best to use