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
[Doc] Removed links for 'As' in text..
[simgrid.git]
/
include
/
smpi
/
smpi_cocci.h
diff --git
a/include/smpi/smpi_cocci.h
b/include/smpi/smpi_cocci.h
index
f082355
..
f938a9b
100644
(file)
--- a/
include/smpi/smpi_cocci.h
+++ b/
include/smpi/smpi_cocci.h
@@
-1,4
+1,4
@@
-/* Copyright (c) 2011. The SimGrid Team.
+/* Copyright (c) 2011
-2014
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-13,18
+13,18
@@
#define SMPI_VARINIT_GLOBAL(name,type) \
type *name = NULL; \
#define SMPI_VARINIT_GLOBAL(name,type) \
type *name = NULL; \
-
void __attribute__((weak,
constructor)) __preinit_##name(void) { \
+
static void __attribute__((
constructor)) __preinit_##name(void) { \
if(!name) \
if(!name) \
- name = (type*)
malloc(smpi_global_size() * sizeof(type));
\
+ name = (type*)
calloc(smpi_global_size(), sizeof(type));
\
} \
} \
-
void __attribute__((weak,
destructor)) __postfini_##name(void) { \
+
static void __attribute__((
destructor)) __postfini_##name(void) { \
free(name); \
name = NULL; \
}
#define SMPI_VARINIT_GLOBAL_AND_SET(name,type,expr) \
type *name = NULL; \
free(name); \
name = NULL; \
}
#define SMPI_VARINIT_GLOBAL_AND_SET(name,type,expr) \
type *name = NULL; \
-
void __attribute__((weak,
constructor)) __preinit_##name(void) { \
+
static void __attribute__((
constructor)) __preinit_##name(void) { \
size_t size = smpi_global_size(); \
size_t i; \
type value = expr; \
size_t size = smpi_global_size(); \
size_t i; \
type value = expr; \
@@
-35,7
+35,7
@@
void __attribute__((weak,constructor)) __preinit_##name(void) { \
} \
} \
} \
} \
} \
} \
-
void __attribute__((weak,
destructor)) __postfini_##name(void) { \
+
static void __attribute__((
destructor)) __postfini_##name(void) { \
free(name); \
name = NULL; \
}
free(name); \
name = NULL; \
}
@@
-55,8
+55,8
@@
XBT_PUBLIC(void) smpi_free_static(void);
#define SMPI_VARINIT_STATIC(name,type) \
static type *name = NULL; \
if(!name) { \
#define SMPI_VARINIT_STATIC(name,type) \
static type *name = NULL; \
if(!name) { \
- name = (type*)
malloc(smpi_global_size() * sizeof(type));
\
- smpi_register_static(name, xbt_free
);
\
+ name = (type*)
calloc(smpi_global_size(), sizeof(type));
\
+ smpi_register_static(name, xbt_free
_f);
\
}
#define SMPI_VARINIT_STATIC_AND_SET(name,type,expr) \
}
#define SMPI_VARINIT_STATIC_AND_SET(name,type,expr) \
@@
-69,7
+69,7
@@
if(!name) { \
for(i = 0; i < size; i++) { \
name[i] = value; \
} \
for(i = 0; i < size; i++) { \
name[i] = value; \
} \
- smpi_register_static(name, xbt_free
);
\
+ smpi_register_static(name, xbt_free
_f);
\
}
#define SMPI_VARGET_STATIC(name) name[smpi_process_index()]
}
#define SMPI_VARGET_STATIC(name) name[smpi_process_index()]