Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
On windows, try_compile may use another compiler than the one we want.
[simgrid.git] / src / surf / cpu_ti.c
index 127d1ea..9a61031 100644 (file)
@@ -1,5 +1,5 @@
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -161,12 +161,12 @@ static void* cpu_ti_create_resource(const char *name, xbt_dynar_t power_peak,
               name);
   xbt_assert(core==1,"Multi-core not handled with this model yet");
   cpu = (cpu_ti_t) surf_resource_new(sizeof(s_cpu_ti_t),
-          surf_cpu_model, name,cpu_properties);
+          surf_cpu_model, name,cpu_properties, NULL);
   cpu->action_set =
       xbt_swag_new(xbt_swag_offset(ti_action, cpu_list_hookup));
 
-
   xbt_dynar_get_cpy(power_peak, 0, &cpu->power_peak);
+  xbt_dynar_free(&power_peak);  /* kill memory leak */
   //cpu->power_peak = power_peak;
   cpu->pstate = pstate;
   XBT_DEBUG("CPU create: peak=%lf, pstate=%d",cpu->power_peak, cpu->pstate);