code: func (dwpt *DocumentsWriterPerThread) reserveDoc() {
  	if atomic.AddInt64(dwpt.pendingNumDocs, 1) > int64(actualMaxDocs) {
  		// reserve failed
  		atomic.AddInt64(dwpt.pendingNumDocs, -1)
  		panic(fmt.Sprintf("number of documents in the index cannot exceed %v", actualMaxDocs))
  	}
  }
docs: /*
  Anything that will add N docs to the index should reserve first to
  make sure it's allowed.
  */