Back out e69aaae67541 (bug 1197941) for being worse than the disease
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 29 Sep 2015 19:19:22 -0700
changeset 265099 e5ee1b65e448cea794fa81aed7f4a4aeb63ac3a1
parent 265098 c6dfe20cbb8acd87f7f5a27d14e22fbf8731aa78
child 265100 09eb2d17aa32ef1b534ffbe9959acb51d5748a0f
push id65842
push userphilringnalda@gmail.com
push dateWed, 30 Sep 2015 02:19:34 +0000
treeherdermozilla-inbound@e5ee1b65e448 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1197941
milestone44.0a1
backs oute69aaae67541417b204fcda9313e693c862ffe02
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out e69aaae67541 (bug 1197941) for being worse than the disease CLOSED TREE
js/src/devtools/rootAnalysis/utility.js
--- a/js/src/devtools/rootAnalysis/utility.js
+++ b/js/src/devtools/rootAnalysis/utility.js
@@ -153,26 +153,26 @@ function cLibrary()
     } catch(e) {
         lib = ctypes.open("libc.so");
     }
 
     return {
         fopen: lib.declare("fopen", ctypes.default_abi, ctypes.void_t.ptr, ctypes.char.ptr, ctypes.char.ptr),
         getline: lib.declare("getline", ctypes.default_abi, ctypes.ssize_t, ctypes.char.ptr.ptr, ctypes.size_t.ptr, ctypes.void_t.ptr),
         fclose: lib.declare("fopen", ctypes.default_abi, ctypes.int, ctypes.void_t.ptr),
-        free: lib.declare("free", ctypes.default_abi, ctypes.void_t.ptr),
+        setvbuf: lib.declare("setvbuf", ctypes.default_abi, ctypes.int, ctypes.void_t.ptr, ctypes.char.ptr, ctypes.int, ctypes.size_t),
     };
 }
 
 function* readFileLines_gen(filename)
 {
-    var libc = cLibrary();
-    var linebuf = ctypes.char.ptr();
-    var bufsize = ctypes.size_t(0);
-    var fp = libc.fopen(filename, "r");
-    if (fp.isNull())
-        throw "Unable to open '" + filename + "'"
+  var libc = cLibrary();
+  var linebuf = ctypes.char.array(4096)();
+  var bufsize = ctypes.size_t(4096);
+  var fp = libc.fopen(filename, "r");
+  if (fp.isNull())
+    throw "Unable to open '" + filename + "'"
 
-    while (libc.getline(linebuf.address(), bufsize.address(), fp) > 0)
-        yield linebuf.readString();
-    libc.fclose(fp);
-    libc.free(ctypes.void_t.ptr(linebuf));
+  var bufp = ctypes.char.ptr(linebuf.addressOfElement(0));
+  while (libc.getline(bufp.address(), bufsize.address(), fp) > 0)
+    yield bufp.readString();
+  libc.fclose(fp);
 }