1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/internal
Alan Wu 37e6c83609 Lazily insert origins on prepend to save memory
98286e9850 made it so that
`Module#include` allocates an origin iclass on each use. Since `include`
is widely used, the extra allocation can contribute significantly to
memory usage.

Instead of always allocating in anticipation of prepend, this change
takes a different approach. The new setup inserts a origin iclass into
the super chains of all the children of the module when prepend happens
for the first time.

rb_ensure_origin is made static again since now that adding an origin
now means walking over all usages, we want to limit the number of places
where we do it.
2020-07-22 19:01:28 -04:00
..
array.h
bignum.h
bits.h
class.h Lazily insert origins on prepend to save memory 2020-07-22 19:01:28 -04:00
compar.h
compile.h
compilers.h
complex.h
cont.h
dir.h
enc.h
encoding.h
enum.h
enumerator.h
error.h
eval.h
file.h
fixnum.h
gc.h
hash.h
imemo.h Fix missing imemo cases in objspace_dump by refactoring 2020-07-10 22:42:35 -04:00
inits.h
io.h
load.h
loadpath.h
math.h
missing.h
mjit.h
numeric.h fix MJIT link error 2020-07-13 08:56:18 +09:00
object.h inline Primitive.cexpr! 2020-07-13 08:56:18 +09:00
parse.h
proc.h
process.h
random.h
range.h
rational.h Renamed nurat_sub compliant with rb_rational_plus 2020-07-01 22:41:15 +09:00
re.h
sanitizers.h
serial.h
signal.h
static_assert.h
string.h
struct.h
symbol.h
thread.h Move declarations to private internal/thread.h header. 2020-07-20 13:20:58 +12:00
time.h
transcode.h
util.h
variable.h Use ID instead of GENTRY for gvars. (#3278) 2020-07-03 16:56:44 +09:00
vm.h
warnings.h