Project

General

Profile

« Previous | Next » 

Revision 5871ecf9

Added by peterzhu2118 (Peter Zhu) almost 3 years ago

Add RARRAY_LITERAL_FLAG for array literals

Array created as literals during iseq compilation don't need a
reference count since they can never be modified. The previous
implementation would mutate the hidden array's reference count,
causing copy-on-write invalidation.

This commit adds a RARRAY_LITERAL_FLAG for arrays created through
rb_ary_literal_new. Arrays created with this flag do not have reference
count stored and just assume they have infinite number of references.

Co-authored-by: Jean Boussier