forked from ruby/ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[pull] master from ruby:master #361
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduces a new flavor of unescaping, YP_UNESCAPE_WHITESPACE, which is the same as MINIMAL but also unescapes whitespace. Note that a spanning_heredoc.txt fixture test is updated to be less wrong, but YARP's behavior doesn't yet fully match Ruby in this case. Fixes ruby/prism#1505 ruby/prism@0af69bdeb1
…green CI is currently failing due to an issue with Ripper on the latest TruffleRuby version. This commit removes the offending tests from running, to ensure CI is green again. ruby/prism@dae2c80c42
Respect the current indentation ruby/prism@068333ef49
* Add $YARP_SERIALIZE_ONLY_SEMANTICS_FIELDS to control where to serialize location fields at templating time, this way there is no overhead for either case and nothing to check at runtime. * Add a byte in the header to indicate whether location fields are included as expected. * Fixes ruby/prism#807 * Simplify the build-java CI job now that the FFI backend is available so JRuby can serialize. * Support keeping some location fields which are still needed until there is a replacement ruby/prism@fc5cf2df12
Init_Method no longer has any code, so we can remove it.
Avoid alerting on failing with commits like ruby/psych@fb97d89
It was deleted in 7fc73ab.
…ader * Fixes ruby/prism#1389 * Fields of type `string` as kept as byte[]. ruby/prism@234c8f47c7
…to safely load permitted classes/symbols rubygems/rubygems@7e4478fe73
Allow for variance in order of dumped ivars, fix by setting the disallowed ivar on an object that will have no other ivars so the index is consistent rubygems/rubygems@ccb8f42753
``` ==> memprof.after.txt <== Total allocated: 673.08 kB (7644 objects) Total retained: 107.35 kB (1018 objects) ==> memprof.before.txt <== Total allocated: 739.12 kB (9140 objects) Total retained: 138.61 kB (1695 objects) ``` Savings will scale by the number of lines in the lockfile rubygems/rubygems@f6abf4439c
* Reword the description in README for more clarity. * Add a compatibility matrix of our stable branches and explain the maintenance policy. * Remove the obsolete paragraph for how to use the gem in Ruby 2.3, which is no longer supported. ruby/openssl@7691034fcb
Co-Authored-By: kddnewton <kevin.newton@shopify.com>
NODE_ARGS, NODE_ARYPTN, NODE_FNDPTN manage memory of their structure by imemo tmpbuf Object. However rb_ast_struct has reference to NODE. Then these memory can be freed directly when rb_ast_struct is freed. This commit reduces parser's dependency on CRuby functions.
* The latest release does not have this fix: oracle/truffleruby@c77f8bb ruby/zlib@8abc80b994
``` <compiled>:1: warning: already initialized constant Bar test/yarp/compiler_test.rb:139: warning: previous definition of Bar was here ```
fix memory leak in vm_method This introduces a unified reference_count to clarify who is referencing a method. This also allows us to treat the refinement method as the def owner since it counts itself as a reference Co-authored-by: Peter Zhu <peter@peterzhu.ca>
* [YARP] Reject numbered parameters in block parameters * [YARP] Do not allow BEGIN except the toplevel --------- Co-authored-by: Haldun Bayhantopcu <haldun@github.com>
Use the integer base flag
Compilation is failing on m68k-linux with: ``` ./include/ruby/internal/static_assert.h:51:46: error: static assertion failed: "sizeof_method_def: offsetof(rb_method_definition_t, body)==8" 51 | # define RBIMPL_STATIC_ASSERT0 __extension__ _Static_assert | ^~~~~~~~~~~~~~ ./include/ruby/internal/static_assert.h:70:5: note: in expansion of macro 'RBIMPL_STATIC_ASSERT0' 70 | RBIMPL_STATIC_ASSERT0(expr, # name ": " # expr) | ^~~~~~~~~~~~~~~~~~~~~ ./internal/static_assert.h:13:24: note: in expansion of macro 'RBIMPL_STATIC_ASSERT' 13 | # define STATIC_ASSERT RBIMPL_STATIC_ASSERT | ^~~~~~~~~~~~~~~~~~~~ ./method.h:203:1: note: in expansion of macro 'STATIC_ASSERT' 203 | STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body)==8); | ^~~~~~~~~~~~~ ```
Rails uses IPAddr#include? to evaluate what it should use as the client's remote ip by filtering potential ips against a trusted list of internal ips. In a _very_ minimal app, #include? was showing up in a profile as ~1% of request time. The issue is that #include? was converting itself and the other value passed in to ranges of IPAddr. This mean as a worst case (where other is a non-IPAddr, like a String) then there would be 5 IPAddr instances created (other -> IPAddr, and two each for the conversions to ranges). However, wrapping the begin and end values as IPAddr is not needed because they are necessarily fixed addresses already. This patch extracts the logic for getting the begin_addr and end_addr from the #to_range method so that they can be used in #include? without having to instantiate so many IPAddr. Benchmark: ```ruby net1 = IPAddr.new("192.168.2.0/24") net2 = IPAddr.new("192.168.2.100") net3 = IPAddr.new("192.168.3.0") net4 = IPAddr.new("192.168.2.0/16") Benchmark.ips do |x| x.report("/24 includes address") { net1.include? net2 } x.report("/24 not includes address") { net1.include? net3 } x.report("/16 includes /24") { net4.include? net1 } x.report("/24 not includes /16") { net1.include? net4 } x.compare! end ``` Before: ``` Comparison: /24 not includes /16: 175041.3 i/s /24 not includes address: 164933.2 i/s - 1.06x (± 0.00) slower /16 includes /24: 163881.9 i/s - 1.07x (± 0.00) slower /24 includes address: 163558.4 i/s - 1.07x (± 0.00) slower ``` After: ``` Comparison: /24 not includes /16: 2588364.9 i/s /24 not includes address: 1474650.7 i/s - 1.76x (± 0.00) slower /16 includes /24: 1461351.0 i/s - 1.77x (± 0.00) slower /24 includes address: 1425463.5 i/s - 1.82x (± 0.00) slower ```
For some reason, it's been failing only on YJIT, but apparently it's reproducible on the interpreter as well. So it's not related to YJIT. rbs marked rbs tests on Ruby master as allow_failures ruby/rbs#1536, so it's known to not work on Ruby master. We should revert this once we fix the flaky test failure on Ruby master.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )