Make the subshell buffer size configurable. Default to 8MB to let big template code get through

refactor
Matt Godbolt 11 years ago
parent c560ee5508
commit a719d601ed

@ -127,19 +127,21 @@ function compile(req, res) {
child.stderr.on('data', function (data) { stderr += data; });
child.on('exit', function (code) {
clearTimeout(timeout);
child_process.exec('cat "' + outputFilename + '" | c++filt', function(err, filt_stdout, filt_stderr) {
var data = filt_stdout;
if (err) {
data = '<No output>';
}
child_process.exec('cat "' + outputFilename + '" | c++filt',
{ maxBuffer: props.get("gcc-explorer", "max-asm-size", 8 * 1024 * 1024) },
function(err, filt_stdout, filt_stderr) {
var data = filt_stdout;
if (err) {
data = '<No output: ' + err + '>';
}
res.end(JSON.stringify({
stdout: stdout,
stderr: stderr,
asm: data,
code: code }));
fs.unlink(outputFilename, function() { fs.rmdir(dirPath); });
});
res.end(JSON.stringify({
stdout: stdout,
stderr: stderr,
asm: data,
code: code }));
fs.unlink(outputFilename, function() { fs.rmdir(dirPath); });
});
});
child.stdin.write(source);
child.stdin.end();

@ -2,3 +2,4 @@
compileTimeoutMs=300
compilers=/usr/bin/g++-4.4:/usr/bin/g++-4.5:/usr/bin/g++-4.6:/usr/bin/g++-4.7:/usr/bin/arm-linux-gnueabi-g++-4.5:/usr/bin/clang++:/usr/bin/avr-g++:/usr/bin/msp430-g++:/usr/bin/arm-linux-gnueabi-g++-4.6
compiler-wrapper=./c-preload/compiler-wrapper
max-asm-size=262144

Loading…
Cancel
Save