Remove free

Don't need it since we aren't malloc'ing
This commit is contained in:
stuart nelson 2016-09-17 19:14:31 +02:00
parent cc5142a007
commit 4b4385bd44
1 changed files with 0 additions and 9 deletions

View File

@ -97,16 +97,9 @@ int getCPUTimes(int *ncpu, struct exported_cputime **cputime) {
*cputime = &xp_t[0];
// free(&cp_t);
return 0;
}
void freeCPUTimes(double *cpu_times) {
free(cpu_times);
}
*/
import "C"
@ -156,8 +149,6 @@ func (c *statCollector) Update(ch chan<- prometheus.Metric) (err error) {
if C.getCPUTimes(&ncpu, &cpuTimesC) == -1 {
return errors.New("could not retrieve CPU times")
}
// TODO: Remember to free variables
// defer C.freeCPUTimes(cpuTimesC)
cpuTimes := (*[1 << 30]C.struct_exported_cputime)(unsafe.Pointer(cpuTimesC))[:ncpu:ncpu]