type intSet … func newIntSet() *intSet { … } // has returns true if the specified id has a positive refcount. // it is safe to call concurrently, but must not be called concurrently with any of the other methods. func (s *intSet) has(i int) bool { … } // reset removes all ids, effectively setting their refcounts to 0. // it is not thread-safe. func (s *intSet) reset() { … } // increment adds one to the refcount of the specified id. // it is not thread-safe. func (s *intSet) increment(i int) { … } // decrement removes one from the refcount of the specified id, // and removes the id if the resulting refcount is <= 0. // it will not track refcounts lower than zero. // it is not thread-safe. func (s *intSet) decrement(i int) { … }