Fix that large integer is not GCed with Word-boxing

### 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
  ```
This commit is contained in:
KOBAYASHI Shuji
2020-11-15 16:45:03 +09:00
parent a6119b0077
commit acc114003b
-1
View File
@@ -782,7 +782,6 @@ obj_free(mrb_state *mrb, struct RBasic *obj, int end)
switch (obj->tt) {
/* immediate - no mark */
case MRB_TT_TRUE:
case MRB_TT_INTEGER:
case MRB_TT_SYMBOL:
/* cannot happen */
return;