• KOBAYASHI Shuji's avatar
    Fix that large integer is not GCed with Word-boxing · acc11400
    KOBAYASHI Shuji authored
    ### Example (32-bit Word-boxing)
    
      ```ruby
      # example.rb
      int_count = ObjectSpace.count_objects[:T_INTEGER]||0
      int = 1<<30
      p (ObjectSpace.count_objects[:T_INTEGER]||0) - int_count
      int = nil
      GC.start
      p (ObjectSpace.count_objects[:T_INTEGER]||0) - int_count
      ```
    
    #### Before this patch:
    
      ```console
      $ bin/mruby example.rb
      1
      1
      ```
    
    #### After this patch:
    
      ```console
      $ bin/mruby example.rb
      1
      0
      ```
    acc11400
gc.c 37.9 KB