Commit acc11400 authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

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
  ```
parent a6119b00
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment