code: func (r *RecordList) Add(ev EventBuilder, fn Listener) int {
  	idx, rec := r.Find(ev.Name())
  	if idx == -1 {
  		rec := &record{ev: ev, name: ev.Name()}
  		rec.setList([]unsafe.Pointer{unsafe.Pointer(&fn)})
  		r.append(rec)
  		return 1
  	}
  
  	oldList := rec.getUnsafeList()
  	newCount := len(oldList) - rec.inactiveItems + 1
  	if rec.inactiveItems == 0 {
  		rec.inactiveItems = len(oldList)
  		newList := make([]unsafe.Pointer, len(oldList)*2+1)
  		// copy so that the new list items are at the end of the list,
  		// this lets the slot search later run and find free space faster.
  		copy(newList[len(oldList)+1:], oldList)
  		newList[len(oldList)] = unsafe.Pointer(&fn)
  		rec.setList(newList)
  		return newCount
  	}
  
  	for i, ptr := range oldList {
  		if ptr == nil {
  			rec.storeAtIndex(i, fn)
  			rec.inactiveItems--
  			return newCount
  		}
  	}
  
  	panic("unreachable")
  }
docs: // Add inserts a new listener for an event. Returns the incremented
  // number of listeners. Not thread-safe with other write operations.