*state = NULL;
}
+void gras_cbps_reset(gras_cbps_t state) {
+
+ xbt_dynar_reset(state->lints);
+
+ xbt_dict_free ( &(state->space) );
+ state->space = xbt_dict_new();
+
+ xbt_dynar_reset(state->frames);
+ xbt_dynar_reset(state->globals);
+}
+
/** \brief Declare a new element in the PS, and give it a value.
*
* If an element of that
****************************************************/
gras_cbps_t gras_cbps_new(void);
void gras_cbps_free(gras_cbps_t *state);
+void gras_cbps_reset(gras_cbps_t state);
/***************
* Convertions *
void *src) {
xbt_ex_t e;
- gras_cbps_t state;
+ static gras_cbps_t state=NULL;
xbt_dict_t refs; /* all references already sent */
xbt_assert0(type,"called with NULL type descriptor");
refs = xbt_dict_new();
- state = gras_cbps_new();
+ if (!state)
+ state = gras_cbps_new();
TRY {
gras_datadesc_send_rec(sock,state,refs,type,(char*)src, type->cycle);
} CLEANUP {
xbt_dict_free(&refs);
- gras_cbps_free(&state);
+ gras_cbps_reset(state);
} CATCH(e) {
RETHROW;
}
void *dst) {
xbt_ex_t e;
- gras_cbps_t state; /* callback persistent state */
+ static gras_cbps_t state=NULL; /* callback persistent state */
xbt_dict_t refs; /* all references already sent */
refs = xbt_dict_new();
- state = gras_cbps_new();
+ if (!state)
+ state = gras_cbps_new();
xbt_assert0(type,"called with NULL type descriptor");
TRY {
type->cycle);
} CLEANUP {
xbt_dict_free(&refs);
- gras_cbps_free(&state);
+ gras_cbps_reset(state);
} CATCH(e) {
RETHROW;
}