Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug some memleaks
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 12 Apr 2009 02:27:20 +0000 (02:27 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 12 Apr 2009 02:27:20 +0000 (02:27 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6245 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/gras/all2all/all2all.c
src/gras/Msg/gras_msg_listener.c
src/gras/Virtu/gras_module.c
src/xbt/xbt_sg_synchro.c

index 59e0a34..9efad71 100644 (file)
@@ -56,6 +56,7 @@ int receiver (int argc,char *argv[]) {
                   &expeditor,
                   &data);
      todo--;
                   &expeditor,
                   &data);
      todo--;
+     free(data);
 
      INFO3("Got Data from %s:%d (still %d to go)",
           gras_socket_peer_name(expeditor), gras_socket_peer_port(expeditor),
 
      INFO3("Got Data from %s:%d (still %d to go)",
           gras_socket_peer_name(expeditor), gras_socket_peer_port(expeditor),
index 27649e9..c7f4099 100644 (file)
@@ -42,10 +42,13 @@ static void listener_function(void *p) {
        char got = *(char*)msg.payl;
        if (got == '1') {
          VERB0("Asked to get awake");
        char got = *(char*)msg.payl;
        if (got == '1') {
          VERB0("Asked to get awake");
+         free(msg.payl);
        } else {
          VERB0("Asked to die");
        } else {
          VERB0("Asked to die");
+//       gras_socket_close(me->wakeup_sock_listener_side);
+         free(msg.payl);
          return ;
          return ;
-       }               
+       }
     }
      /* empty the list of sockets to trash */
      TRY {
     }
      /* empty the list of sockets to trash */
      TRY {
@@ -107,6 +110,7 @@ void gras_msg_listener_shutdown(gras_msg_listener_t l) {
    if (gras_if_RL()) 
      xbt_thread_join(pd->listener->listener);
 
    if (gras_if_RL()) 
      xbt_thread_join(pd->listener->listener);
 
+//  gras_socket_close(pd->listener->wakeup_sock_master_side); FIXME: uncommenting this leads to deadlock at terminaison
   xbt_queue_free(&l->incomming_messages);
   xbt_queue_free(&l->socks_to_close);
   xbt_free(l);
   xbt_queue_free(&l->incomming_messages);
   xbt_queue_free(&l->socks_to_close);
   xbt_free(l);
index 8969f5e..177a3ed 100644 (file)
@@ -85,6 +85,7 @@ static xbt_set_t _gras_modules = NULL; /* content: s_gras_module_t */
 
 static void gras_module_freep(void *p) {
    free( ((gras_module_t)p) ->name);
 
 static void gras_module_freep(void *p) {
    free( ((gras_module_t)p) ->name);
+   free(p);
 }
 
 
 }
 
 
index 120a1f2..00dd1a4 100644 (file)
@@ -32,6 +32,8 @@ static int xbt_thread_create_wrapper(int argc, char *argv[]) {
   xbt_thread_t t = (xbt_thread_t)SIMIX_process_get_data(SIMIX_process_self());
   SIMIX_process_set_data(SIMIX_process_self(),t->father_data);
   (*t->code)(t->userparam);
   xbt_thread_t t = (xbt_thread_t)SIMIX_process_get_data(SIMIX_process_self());
   SIMIX_process_set_data(SIMIX_process_self(),t->father_data);
   (*t->code)(t->userparam);
+  free(t->name);
+  free(t);
   return 0;
 }
 
   return 0;
 }