code: func (t *Collection) SetItem(item *Item) (err error) {
  	if t.store.readOnly {
  		return errors.New("store is read only")
  	}
  	if item.Key == nil || len(item.Key) > 0xffff || len(item.Key) == 0 ||
  		item.Val == nil {
  		return errors.New("Item.Key/Val missing or too long")
  	}
  	if item.Priority < 0 {
  		return errors.New("Item.Priority must be non-negative")
  	}
  	rnl := t.rootAddRef()
  	defer t.rootDecRef(rnl)
  	root := rnl.root
  	n := t.mkNode(nil, nil, nil, 1, uint64(len(item.Key))+uint64(item.NumValBytes(t)))
  	t.store.ItemAddRef(t, item)
  	n.item.item = unsafe.Pointer(item) // Avoid garbage via separate init.
  	nloc := t.mkNodeLoc(n)
  	defer t.freeNodeLoc(nloc)
  	r, err := t.store.union(t, root, nloc, &rnl.reclaimMark)
  	if err != nil {
  		return err
  	}
  	rnlNew := t.mkRootNodeLoc(r)
  	// Can't reclaim n right now because r might point to n.
  	rnlNew.reclaimLater[0] = t.reclaimMarkUpdate(nloc,
  		&rnl.reclaimMark, &rnlNew.reclaimMark)
  	if !t.rootCAS(rnl, rnlNew) {
  		return errors.New("concurrent mutation attempted")
  	}
  	t.rootDecRef(rnl)
  	return nil
  }
docs: // Replace or insert an item of a given key.
  // A random item Priority (e.g., rand.Int31()) will usually work well,
  // but advanced users may consider using non-random item priorities
  // at the risk of unbalancing the lookup tree.  The input Item instance
  // should be considered immutable and owned by the Collection.