code: func NewTreePool(hasher BaseHasherFunc, segmentCount, capacity int) *TreePool {
  	// initialises the zerohashes lookup table
  	depth := calculateDepthFor(segmentCount)
  	segmentSize := hasher().Size()
  	zerohashes := make([][]byte, depth+1)
  	zeros := make([]byte, segmentSize)
  	zerohashes[0] = zeros
  	h := hasher()
  	for i := 1; i < depth+1; i++ {
  		zeros = doSum(h, nil, zeros, zeros)
  		zerohashes[i] = zeros
  	}
  	return &TreePool{
  		c:            make(chan *tree, capacity),
  		hasher:       hasher,
  		SegmentSize:  segmentSize,
  		SegmentCount: segmentCount,
  		Capacity:     capacity,
  		Size:         segmentCount * segmentSize,
  		Depth:        depth,
  		zerohashes:   zerohashes,
  	}
  }
docs: // NewTreePool creates a tree pool with hasher, segment size, segment count and capacity
  // on Hasher.getTree it reuses free trees or creates a new one if capacity is not reached