git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2765
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
int gras_datadesc_copy(gras_datadesc_type_t type,
void *src, void *dst) {
xbt_ex_t e;
int gras_datadesc_copy(gras_datadesc_type_t type,
void *src, void *dst) {
xbt_ex_t e;
- static gras_cbps_t state=NULL;
- xbt_dict_t refs; /* all references already sent */
+ static gras_cbps_t state=NULL;
+ static xbt_dict_t refs=NULL; /* all references already sent */
int size=0;
xbt_assert0(type,"called with NULL type descriptor");
int size=0;
xbt_assert0(type,"called with NULL type descriptor");
- refs = xbt_dict_new();
- if (!state)
+ refs = xbt_dict_new();
+ }
TRY {
size = gras_datadesc_copy_rec(state,refs,type,(char*)src,(char*)dst,0,
type->cycle);
} CLEANUP {
TRY {
size = gras_datadesc_copy_rec(state,refs,type,(char*)src,(char*)dst,0,
type->cycle);
} CLEANUP {
gras_cbps_reset(state);
} CATCH(e) {
RETHROW;
gras_cbps_reset(state);
} CATCH(e) {
RETHROW;
xbt_ex_t e;
static gras_cbps_t state=NULL;
xbt_ex_t e;
static gras_cbps_t state=NULL;
- xbt_dict_t refs; /* all references already sent */
+ static xbt_dict_t refs=NULL; /* all references already sent */
xbt_assert0(type,"called with NULL type descriptor");
xbt_assert0(type,"called with NULL type descriptor");
- refs = xbt_dict_new();
- if (!state)
+ refs = xbt_dict_new();
+ }
+
TRY {
gras_datadesc_send_rec(sock,state,refs,type,(char*)src, type->cycle);
} CLEANUP {
TRY {
gras_datadesc_send_rec(sock,state,refs,type,(char*)src, type->cycle);
} CLEANUP {
gras_cbps_reset(state);
} CATCH(e) {
RETHROW;
gras_cbps_reset(state);
} CATCH(e) {
RETHROW;
xbt_ex_t e;
static gras_cbps_t state=NULL; /* callback persistent state */
xbt_ex_t e;
static gras_cbps_t state=NULL; /* callback persistent state */
- xbt_dict_t refs; /* all references already sent */
+ static xbt_dict_t refs=NULL; /* all references already sent */
- refs = xbt_dict_new();
- if (!state)
+ refs = xbt_dict_new();
+ }
+
xbt_assert0(type,"called with NULL type descriptor");
TRY {
gras_datadesc_recv_rec(sock, state, refs, type,
xbt_assert0(type,"called with NULL type descriptor");
TRY {
gras_datadesc_recv_rec(sock, state, refs, type,
(char *) dst,-1,
type->cycle);
} CLEANUP {
(char *) dst,-1,
type->cycle);
} CLEANUP {
gras_cbps_reset(state);
} CATCH(e) {
RETHROW;
gras_cbps_reset(state);
} CATCH(e) {
RETHROW;