Commit e2facc5b authored by Igor Murashkin's avatar Igor Murashkin
Browse files

runtime: Add lambda box/unbox object equality

A lambda that is boxed with box-lambda is now stored as a weak reference
in a global runtime table (lambda::BoxTable). Repeatedly boxing the same
lambda closure value will always return the same java.lang.Object back.

Since there is no way to observe the address of an object, a GC can
happen and clean up the table of any dead boxed lambdas, which can also
shrink the table to prevent the memory use from growing too much.

(Note that a lambda closure is immutable, so hashing over it is
guaranteed safe.)

Change-Id: I786c1323ff14eed937936b303d511875f9642524
parent e07300b7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment