From 5b40bb8d159c1432bb87973b2b5f42473dd0c623 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 14 Oct 2020 15:52:14 +0900 Subject: Avoid using C struct dump for test Ruby code. Files under `test/t` and `mrbgem/*/test` are for tests, not for actual execution. So symbols in those files need not to be pre-allocated. This change slightly reduce the memory consumption. --- lib/mruby/build/command.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/mruby/build/command.rb b/lib/mruby/build/command.rb index 39981cc32..3d47c304f 100644 --- a/lib/mruby/build/command.rb +++ b/lib/mruby/build/command.rb @@ -310,16 +310,16 @@ module MRuby def initialize(build) super @command = nil - @compile_options = "-S -B%{funcname} -o-" + @compile_options = "-B%{funcname} -o-" end - def run(out, infiles, funcname) + def run(out, infiles, funcname, cdump = true) @command ||= @build.mrbcfile infiles = [infiles].flatten infiles.each do |f| _pp "MRBC", f.relative_path, nil, :indent => 2 end - cmd = %Q["#{filename @command}" #{@compile_options % {:funcname => funcname}} #{filename(infiles).map{|f| %Q["#{f}"]}.join(' ')}] + cmd = %Q["#{filename @command}" #{cdump ? "-S" : ""} #{@compile_options % {:funcname => funcname}} #{filename(infiles).map{|f| %Q["#{f}"]}.join(' ')}] puts cmd if Rake.verbose IO.popen(cmd, 'r+') do |io| out.puts io.read -- cgit v1.2.3