diff options
author | Koichi Sasada <ko1@atdot.net> | 2019-07-22 17:44:58 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2019-07-22 17:53:10 +0900 |
commit | 1feda1c2b091b950efcaa481a11fd660efa9e717 (patch) | |
tree | 385ccde7762ce9c2b1e3faebd4a386d0a6e300bb /class.c | |
parent | 9095ff53cf6c25154c7f80910aab8d1af45c42ec (diff) | |
download | ruby-1feda1c2b091b950efcaa481a11fd660efa9e717.tar.gz |
constify again.
Same as last commit, make some fields `const`.
include/ruby/ruby.h:
* Rasic::klass
* RArray::heap::aux::shared_root
* RRegexp::src
internal.h:
* rb_classext_struct::origin_, redefined_class
* vm_svar::cref_or_me, lastline, backref, others
* vm_throw_data::throw_obj
* vm_ifunc::data
* MEMO::v1, v2, u3::value
While modifying this patch, I found write-barrier miss on
rb_classext_struct::redefined_class.
Also vm_throw_data::throw_state is only `int` so change the type.
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -176,7 +176,7 @@ class_alloc(VALUE flags, VALUE klass) */ RCLASS_SET_ORIGIN((VALUE)obj, (VALUE)obj); RCLASS_SERIAL(obj) = rb_next_class_serial(); - RCLASS_REFINED_CLASS(obj) = Qnil; + RB_OBJ_WRITE(obj, &RCLASS_REFINED_CLASS(obj), Qnil); RCLASS_EXT(obj)->allocator = 0; return (VALUE)obj; |