Project

General

Profile

« Previous | Next » 

Revision 57a0afe2

Added by NARUSE, Yui over 1 year ago

merge revision(s) 081ee3d35509110f383cb7dd8d1205def0cdd1e8,1c97abaabae6844c861705fd07f532292dcffa74: [Backport #19907] (#10315)

Add memory leak test for eval kwargs

    De-dup identical callinfo objects

    Previously every call to vm_ci_new (when the CI was not packable) would
    result in a different callinfo being returned this meant that every
    kwarg callsite had its own CI.

    When calling, different CIs result in different CCs. These CIs and CCs
    both end up persisted on the T_CLASS inside cc_tbl. So in an eval loop
    this resulted in a memory leak of both types of object. This also likely
    resulted in extra memory used, and extra time searching, in non-eval
    cases.

    For simplicity in this commit I always allocate a CI object inside
    rb_vm_ci_lookup, but ideally we would lazily allocate it only when
    needed. I hope to do that as a follow up in the future.