mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user