mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Store backtrace to field of struct RException
Since the possible values of the backtrace are limited to `nil`, `RData`, and `RAray`, they are now stored as object pointers. This change saves memory by eliminating the need to use instance variables for common exceptions. ref. #2485
This commit is contained in:
+2
-1
@@ -182,7 +182,8 @@ set_backtrace(mrb_state *mrb, mrb_value exc, mrb_value backtrace)
|
||||
p++;
|
||||
}
|
||||
}
|
||||
mrb_iv_set(mrb, exc, MRB_SYM(backtrace), backtrace);
|
||||
mrb_exc_ptr(exc)->backtrace = mrb_obj_ptr(backtrace);
|
||||
mrb_field_write_barrier_value(mrb, mrb_basic_ptr(exc), backtrace);
|
||||
}
|
||||
|
||||
static mrb_value
|
||||
|
||||
Reference in New Issue
Block a user