From b939dbd8142d3ef8c5e598dbfcd004f02089329f Mon Sep 17 00:00:00 2001 From: Tim Rogers Date: Thu, 19 Jul 2012 08:19:21 -0800 Subject: Fixing an error reported by valgrind. Is really harmless since you can call delete on primatives allocated with new[] without consequence (all delete [] does is ensure that the destructors will be called) Still, it is always good practice to de-allocate anything allocated with new[] with delete[] - just in case the type allocated changes and the person that changes it forgets to update the de-allocation. Really, this little array should be on the stack... [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13414] --- src/gpgpu-sim/shader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h index 558335e..d246393 100644 --- a/src/gpgpu-sim/shader.h +++ b/src/gpgpu-sim/shader.h @@ -990,7 +990,7 @@ struct shader_core_config : public core_config assert(ntok == 1); toks = strtok(NULL,","); } - delete tokd; + delete[] tokd; if (n_thread_per_shader > MAX_THREAD_PER_SM) { printf("GPGPU-Sim uArch: Error ** increase MAX_THREAD_PER_SM in abstract_hardware_model.h from %u to %u\n", -- cgit v1.3