1. 10 Jul, 2021 2 commits
  2. 09 Jul, 2021 9 commits
  3. 08 Jul, 2021 5 commits
  4. 07 Jul, 2021 6 commits
  5. 06 Jul, 2021 2 commits
  6. 05 Jul, 2021 1 commit
  7. 03 Jul, 2021 2 commits
  8. 02 Jul, 2021 5 commits
  9. 30 Jun, 2021 2 commits
  10. 29 Jun, 2021 3 commits
  11. 28 Jun, 2021 3 commits
    • dearblue's avatar
      Avoid warnings with `ruby -cw` · 2d0b50f6
      dearblue authored
      ```console
      % for rb in `git ls-files '*/mrblib/*.rb' 'mrblib'`; do ruby30 -cw $rb > /dev/null; done
      mrbgems/mruby-array-ext/mrblib/array.rb:389: warning: assigned but unused variable - ary
      mrbgems/mruby-array-ext/mrblib/array.rb:663: warning: assigned but unused variable - len
      mrbgems/mruby-hash-ext/mrblib/hash.rb:119: warning: possibly useless use of a variable in void context
      mrbgems/mruby-hash-ext/mrblib/hash.rb:259: warning: assigned but unused variable - keys
      mrbgems/mruby-io/mrblib/io.rb:229: warning: literal in condition
      mrbgems/mruby-io/mrblib/io.rb:280: warning: literal in condition
      mrbgems/mruby-string-ext/mrblib/string.rb:347: warning: assigned but unused variable - len
      mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb:2: warning: parentheses after method name is interpreted as an argument list, not a decomposed argument
      ```
      2d0b50f6
    • dearblue's avatar
      Drop unnecessary upper procs linked from class/module/def syntax · 59201b59
      dearblue authored
      It does not need to hold an anonymous proc for constant search.
      Also, this change can be expected to cause an anonymous proc to be GC'd.
      
      This is useful for metaprogramming that makes heavy use of the `class`/`module`/`def` syntax in the `class_eval`/`eval` method.
      
      Example:
      
      - code
      
        ```ruby
        p ObjectSpace.count_objects
      
        String.class_eval do
          def a
          end
        end
      
        p ObjectSpace.count_objects
      
        String.class_eval do
          eval <<~CODE
            def b
            end
          CODE
        end
      
        p ObjectSpace.count_objects
        ```
      
      - result of building mruby-head (d63c0df6) with `build_config/default.rb`
      
        ```
        {:TOTAL=>1024, :FREE=>262, :T_PROC=>495, :T_ENV=>61, ...}
        {:TOTAL=>1024, :FREE=>259, :T_PROC=>497, :T_ENV=>62, ...}
        {:TOTAL=>1024, :FREE=>255, :T_PROC=>500, :T_ENV=>63, ...}
        ```
      
      - result of building mruby with this patch and `build_config/default.rb`
      
        ```
        {:TOTAL=>1024, :FREE=>264, :T_PROC=>494, :T_ENV=>60, ...}
        {:TOTAL=>1024, :FREE=>262, :T_PROC=>495, :T_ENV=>61, ...}
        {:TOTAL=>1024, :FREE=>261, :T_PROC=>496, :T_ENV=>61, ...}
        ```
      59201b59
    • Yukihiro "Matz" Matsumoto's avatar
      Merge pull request #5493 from dearblue/binding.2 · d63c0df6
      Yukihiro "Matz" Matsumoto authored
      Fixed finding variables from `proc` in `binding.eval` failed
      d63c0df6