class Concurrent::AbstractLocals

def free_index(index)

def free_index(index)
  weak_synchronize do
    # The cost of GC'ing a TLV is linear in the number of ECs using local
    # variables. But that is natural! More ECs means more storage is used
    # per local variable. So naturally more CPU time is required to free
    # more storage.
    #
    # DO NOT use each_value which might conflict with new pair assignment
    # into the hash in #set method.
    @all_arrays.values.each do |locals|
      locals[index] = nil
    end
    # free index has to be published after the arrays are cleared:
    @free << index
  end
end