code: func mmap(db *DB, sz int) error {
  	// Map the data file to memory.
  	b, err := unix.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags)
  	if err != nil {
  		return err
  	}
  
  	// Advise the kernel that the mmap is accessed randomly.
  	if err := unix.Madvise(b, syscall.MADV_RANDOM); err != nil {
  		return fmt.Errorf("madvise: %s", err)
  	}
  
  	// Save the original byte slice and convert to a byte array pointer.
  	db.dataref = b
  	db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0]))
  	db.datasz = sz
  	return nil
  }
docs: // mmap memory maps a DB's data file.