A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Also reset the refs dict instead of freeing it each time
[simgrid.git]
/
src
/
gras
/
DataDesc
/
ddt_exchange.c
diff --git
a/src/gras/DataDesc/ddt_exchange.c
b/src/gras/DataDesc/ddt_exchange.c
index
18f0caa
..
091654f
100644
(file)
--- a/
src/gras/DataDesc/ddt_exchange.c
+++ b/
src/gras/DataDesc/ddt_exchange.c
@@
-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;
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)
+ if (!state) {
state = gras_cbps_new();
state = gras_cbps_new();
+ 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 {
- xbt_dict_
free(&
refs);
+ xbt_dict_
reset(
refs);
gras_cbps_reset(state);
} CATCH(e) {
RETHROW;
gras_cbps_reset(state);
} CATCH(e) {
RETHROW;
@@
-610,18
+611,19
@@
void gras_datadesc_send(gras_socket_t sock,
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)
+ if (!state) {
state = gras_cbps_new();
state = gras_cbps_new();
-
+ 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 {
- xbt_dict_
free(&
refs);
+ xbt_dict_
reset(
refs);
gras_cbps_reset(state);
} CATCH(e) {
RETHROW;
gras_cbps_reset(state);
} CATCH(e) {
RETHROW;
@@
-947,12
+949,13
@@
gras_datadesc_recv(gras_socket_t sock,
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)
+ if (!state) {
state = gras_cbps_new();
state = gras_cbps_new();
-
+ 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,
@@
-960,7
+963,7
@@
gras_datadesc_recv(gras_socket_t sock,
(char *) dst,-1,
type->cycle);
} CLEANUP {
(char *) dst,-1,
type->cycle);
} CLEANUP {
- xbt_dict_
free(&
refs);
+ xbt_dict_
reset(
refs);
gras_cbps_reset(state);
} CATCH(e) {
RETHROW;
gras_cbps_reset(state);
} CATCH(e) {
RETHROW;