]> AND Public Git Repository - simgrid.git/blobdiff - examples/c/app-chainsend/peer.c
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add a tesh for bugged2-liveness
[simgrid.git] / examples / c / app-chainsend / peer.c
index d49e9f7f5a77dabfd2cea6ce94003d7fdb46a1fd..82459082bd36b6cb8d7854810bbb87611136d485 100644 (file)
@@ -58,13 +58,13 @@ static void peer_forward_file(peer_t p)
 
 static peer_t peer_init(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
-  peer_t p           = (peer_t)malloc(sizeof(s_peer_t));
+  peer_t p           = xbt_malloc(sizeof(s_peer_t));
   p->prev            = NULL;
   p->next            = NULL;
   p->received_pieces = 0;
   p->received_bytes  = 0;
-  p->pending_recvs   = (sg_comm_t*)malloc(sizeof(sg_comm_t) * MAX_PENDING_COMMS);
-  p->pending_sends   = (sg_comm_t*)malloc(sizeof(sg_comm_t) * MAX_PENDING_COMMS);
+  p->pending_recvs   = xbt_malloc(sizeof(sg_comm_t) * MAX_PENDING_COMMS);
+  p->pending_sends   = xbt_malloc(sizeof(sg_comm_t) * MAX_PENDING_COMMS);
 
   p->me = sg_mailbox_by_name(sg_host_self_get_name());