From eafe0fa644b616c7d265623b17ad69042f79b3e5 Mon Sep 17 00:00:00 2001 From: Matt Godbolt Date: Sun, 5 Apr 2015 22:18:58 -0500 Subject: [PATCH] Revert "Add some (belated) memory watching" This reverts commit 217091010ae42fd142dc681980d95da1be64574f. --- app.js | 50 +++++++++++++++++++++++++------------------------- lib/compile.js | 2 +- package.json | 1 - 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/app.js b/app.js index 1382d353..34a72376 100755 --- a/app.js +++ b/app.js @@ -36,12 +36,12 @@ var nopt = require('nopt'), Promise = require('promise'), memwatch = require('memwatch'); -memwatch.on('leak', function (info) { - console.log("Memwatch leak: " + JSON.stringify(info)); +memwatch.on('leak', function(info){ + console.log("Memwatch leak: " + info); }); -memwatch.on('stats', function (stats) { - console.log("Memwatch stats: " + JSON.stringify(stats)); +memwatch.on('stats', function(stats){ + console.log("Memwatch stats: " + info); }); var opts = nopt({ @@ -195,29 +195,29 @@ function configuredCompilers() { var port = parseInt(bits[1]); console.log("Fetching compilers from remote source " + host + ":" + port); return retryPromise(function () { - return new Promise(function (resolve, reject) { - http.get({ - hostname: host, - port: port, - path: "/api/compilers" - }, function (res) { - var str = ''; - res.on('data', function (chunk) { - str += chunk; - }); - res.on('end', function () { - var compilers = JSON.parse(str).map(function (compiler) { - compiler.exe = null; - compiler.remote = "http://" + host + ":" + port; - return compiler; - }); - resolve(compilers); + return new Promise(function (resolve, reject) { + http.get({ + hostname: host, + port: port, + path: "/api/compilers" + }, function (res) { + var str = ''; + res.on('data', function (chunk) { + str += chunk; + }); + res.on('end', function () { + var compilers = JSON.parse(str).map(function (compiler) { + compiler.exe = null; + compiler.remote = "http://" + host + ":" + port; + return compiler; }); - }).on('error', function (e) { - reject(e); + resolve(compilers); }); + }).on('error', function (e) { + reject(e); }); - }, + }); + }, host + ":" + port, props.get('gcc-explorer', 'proxyRetries', 20), props.get('gcc-explorer', 'proxyRetryMs', 500)); @@ -263,7 +263,7 @@ function getCompilerInfo(compilerInfo) { }); } if (options['-masm']) { - compilerInfo.intelAsm = "-masm=intel"; + compilerInfo.intelAsm="-masm=intel"; } resolve(compilerInfo); }); diff --git a/lib/compile.js b/lib/compile.js index 437b5ebe..02549d1a 100644 --- a/lib/compile.js +++ b/lib/compile.js @@ -46,7 +46,7 @@ function Compile(compilers) { this.cache = LRU({ max: props.get('gcc-explorer', 'cacheMb') * 1024 * 1024, length: function (n) { - return n.asm.length; + return n.length; } }); this.cacheHits = 0; diff --git a/package.json b/package.json index 78cc7771..6ac2f37e 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "fs-extra": "0.8.x", "http-proxy": "1.8.x", "lru-cache": "2.5.x", - "memwatch": "0.2.x", "morgan": "1.5.x", "promise": "6.1.x", "promise-queue": "2.1.x",