code: func (w *WAL) flushPage(clear bool) error {
  	w.pageFlushes.Inc()
  
  	p := w.page
  	clear = clear || p.full()
  
  	// No more data will fit into the page. Enqueue and clear it.
  	if clear {
  		p.alloc = pageSize // Write till end of page.
  		w.pageCompletions.Inc()
  	}
  	n, err := w.segment.Write(p.buf[p.flushed:p.alloc])
  	if err != nil {
  		return err
  	}
  	p.flushed += n
  
  	// We flushed an entire page, prepare a new one.
  	if clear {
  		for i := range p.buf {
  			p.buf[i] = 0
  		}
  		p.alloc = 0
  		p.flushed = 0
  		w.donePages++
  	}
  	return nil
  }
docs: // flushPage writes the new contents of the page to disk. If no more records will fit into
  // the page, the remaining bytes will be set to zero and a new page will be started.
  // If clear is true, this is enforced regardless of how many bytes are left in the page.