-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding malloc_trim call on full GC #5069
Conversation
lib/mruby/build/command.rb
Outdated
@@ -162,6 +188,46 @@ def get_dependencies(file) | |||
end | |||
deps << MRUBY_CONFIG | |||
end | |||
|
|||
def test_code_template(function: nil, header: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is kind of ugly. I didn't know how far back we support Ruby so I didn't use the tilde <<~
form of heredocs to make it a bit less ugly.
lib/mruby/build/command.rb
Outdated
@@ -126,6 +127,31 @@ def define_rules(build_dir, source_dir='') | |||
end | |||
end | |||
|
|||
def compiles?(source_text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matz I hope this is sufficient for what you were thinking about adding autoconf like behavior when we need it.
lib/mruby/build/command.rb
Outdated
# Change to a tmp dir when compiling so we don't litter compiler artifacts | ||
Dir.mktmpdir do |tmpdir| | ||
Dir.chdir tmpdir | ||
sh(command, infile.path, verbose: false) { |retval, _| is_success = retval } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bit of a nuisance here. You cannot silence stderr with the Rake sh
method. When testing for features it may be a legitimate failure, which is why we're asking the compiler. Unfortunately gcc and clang output the compiler errors to stderr
. Doing a shell redirection isn't cross platform. We could use Open3.capture3
instead of sh
, I didn't know if it is okay to require and use.
It appears either mingw or the CI system doesn't allow removing temp directories. That is a strange situation either way. I will work around it. |
I am wondering whether it may be better to specify manually via a macro define, e.g. |
Oh yes it should be prefixed with Are you saying you would like it off by default and enabling it with a custom |
@RoryO yes. Altough it's less intelligent. I'd like to follow KISS principle here. |
39ca243
to
f28e780
Compare
f28e780
to
b0fffef
Compare
Okay, I have done that. |
Thank you! It will be merged to |
Oh that’s new! Okay I changed the base branch. |
Oh, you didn't have to. I did it on my side. |
Thank you anyway. |
Should this be closed then? |
I will close when I push to GitHub. I am struggling with other issues. Wait for a while. |
Merged. |
Follow up on #5047. Does a couple things:
MRuby::Command::Compiler
for asking about headers and functions. I took inspiration from how meson does it, which has a nice API.gcc.rake
. That way if a user has a custombuild_config.rb
they can remove the define if they wish, like if they are using a different allocator than glib.