make_finalizer (Weak::Key)

    # File lib/Borges/Utilities/WeakIdentityKeyHash.rb, line 40
        def self.make_finalizer(internal_id, hash_id)
          return proc do |id|
            Thread.exclusive do
              rids = ID_MAP[id]
              if rids then
                for rid in rids
                  ID_REV_MAP.delete rid
                end

                ID_MAP.delete id
              end

              rid = ID_REV_MAP[id]

              if rid then
                ID_REV_MAP.delete id
                ID_MAP[rid].delete id
                ID_MAP.delete rid if ID_MAP[rid].empty?
              end
            end

            unless hash_id.nil? then
              hash = ObjectSpace._id2ref hash_id
              hash.delete_if do |k, v|
                k.internal_id == internal_id rescue true
              end unless hash.nil?
            end
          end
        end