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.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-10-14 15:52:14 +09:00
parent 82046ff26e
commit 5b40bb8d15
5 changed files with 17 additions and 21 deletions
+3 -3
View File
@@ -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