3 ms·
Does rvalue mean something different here than it normally means? Normally rvalues refer to temporary values.
by eklitzke 6y ago
Does rvalue mean something different here than it normally means? Normally rvalues refer to temporary values.
- jemmaissroff 6y agoThe first post in the series also explains RVALUES in the context of the Ruby Heap if it's helpful https://jemma.dev/blog/gc-internal https://jemma.dev/blog/gc-internal
- dragontamer 6y agoRvalue seems to be a 40-byte "Ruby Object". (If an object takes up more than 40-bytes, it gets an additional allocation, and the first 40-bytes go into the rvalue "slot").
- tenderlove 6y agoRVALUE is the base type in Ruby's heap. It refers specifically to [this struct](https://github.com/ruby/ruby/blob/7bd93293621b85a87e7e117317612bb0a84efb7a/gc.c#L559-L605 https://github.com/ruby/ruby/blob/7bd93293621b85a87e7e117317...). All Ruby objects are instances of an RVALUE struct. Hope that helps!
- WJW 6y agoIn particular in Ruby it derives from "Ruby value" rather than the C/C++ rvalues that can appear on the righthand side of an assignment.
- snvsn 6y agoYes. In the Ruby VM, an RVALUE [0] is a union (a "generic type") of structs that represent all the different kinds of Ruby object types and a couple of runtime types. [0] https://sonots.github.io/ruby-capi/db/d8e/struct_r_v_a_l_u_e.html https://sonots.github.io/ruby-capi/db/d8e/struct_r_v_a_l_u_e...