code: func parseHeapSample(line string, rate int64, sampling string) (value []int64, blocksize int64, addrs []uint64, err error) {
  	sampleData := heapSampleRE.FindStringSubmatch(line)
  	if len(sampleData) != 6 {
  		return value, blocksize, addrs, fmt.Errorf("unexpected number of sample values: got %d, want 6", len(sampleData))
  	}
  
  	// Use first two values by default; tcmalloc sampling generates the
  	// same value for both, only the older heap-profile collect separate
  	// stats for in-use and allocated objects.
  	valueIndex := 1
  	if LegacyHeapAllocated {
  		valueIndex = 3
  	}
  
  	var v1, v2 int64
  	if v1, err = strconv.ParseInt(sampleData[valueIndex], 10, 64); err != nil {
  		return value, blocksize, addrs, fmt.Errorf("malformed sample: %s: %v", line, err)
  	}
  	if v2, err = strconv.ParseInt(sampleData[valueIndex+1], 10, 64); err != nil {
  		return value, blocksize, addrs, fmt.Errorf("malformed sample: %s: %v", line, err)
  	}
  
  	if v1 == 0 {
  		if v2 != 0 {
  			return value, blocksize, addrs, fmt.Errorf("allocation count was 0 but allocation bytes was %d", v2)
  		}
  	} else {
  		blocksize = v2 / v1
  		if sampling == "v2" {
  			v1, v2 = scaleHeapSample(v1, v2, rate)
  		}
  	}
  
  	value = []int64{v1, v2}
  	addrs = parseHexAddresses(sampleData[5])
  
  	return value, blocksize, addrs, nil
  }
docs: // parseHeapSample parses a single row from a heap profile into a new Sample.