X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f22432486ef4631dfc0b19340ae387a0ecf84c20..51a5195725c4c524ee5e84d8bab016472a539617:/src/gras/DataDesc/ddt_exchange.c diff --git a/src/gras/DataDesc/ddt_exchange.c b/src/gras/DataDesc/ddt_exchange.c index 62873e4ace..77915d4c1e 100644 --- a/src/gras/DataDesc/ddt_exchange.c +++ b/src/gras/DataDesc/ddt_exchange.c @@ -160,19 +160,19 @@ gras_datadesc_copy_rec(gras_cbps_t state, if (XBT_LOG_ISENABLED(gras_ddt_exchange,xbt_log_priority_verbose)) { if (sub_type == gras_datadesc_by_name("unsigned int")) { - VERB2("Copied value for field %s: %d (type: unsigned int)",field->name, *(unsigned int*)field_dst); + VERB2("Copied value for field '%s': %d (type: unsigned int)",field->name, *(unsigned int*)field_dst); } else if (sub_type == gras_datadesc_by_name("int")) { - VERB2("Copied value for field %s: %d (type: int)",field->name, *(int*)field_dst); + VERB2("Copied value for field '%s': %d (type: int)",field->name, *(int*)field_dst); } else if (sub_type == gras_datadesc_by_name("unsigned long int")) { - VERB2("Copied value for field %s: %ld (type: unsigned long int)",field->name, *(unsigned long int*)field_dst); + VERB2("Copied value for field '%s': %ld (type: unsigned long int)",field->name, *(unsigned long int*)field_dst); } else if (sub_type == gras_datadesc_by_name("long int")) { - VERB2("Copied value for field %s: %ld (type: long int)",field->name, *(long int*)field_dst); + VERB2("Copied value for field '%s': %ld (type: long int)",field->name, *(long int*)field_dst); } else if (sub_type == gras_datadesc_by_name("string")) { - VERB2("Copied value for field %s: '%s' (type: string)", field->name, *(char**)field_dst); + VERB2("Copied value for field '%s': '%s' (type: string)", field->name, *(char**)field_dst); } else { - VERB1("Copied a value for field %s (type not scalar?)", field->name); + VERB1("Copied a value for field '%s' (type not scalar?)", field->name); } } @@ -369,21 +369,22 @@ gras_datadesc_copy_rec(gras_cbps_t state, int gras_datadesc_copy(gras_datadesc_type_t type, void *src, void *dst) { xbt_ex_t e; - gras_cbps_t state; + static gras_cbps_t state=NULL; xbt_dict_t refs; /* all references already sent */ int size=0; xbt_assert0(type,"called with NULL type descriptor"); refs = xbt_dict_new(); - state = gras_cbps_new(); + if (!state) + state = gras_cbps_new(); TRY { size = gras_datadesc_copy_rec(state,refs,type,(char*)src,(char*)dst,0, type->cycle); } CLEANUP { xbt_dict_free(&refs); - gras_cbps_free(&state); + gras_cbps_reset(state); } CATCH(e) { RETHROW; }