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
Further simplify the mmallocs, and improve its introspection abilities
[simgrid.git]
/
src
/
xbt
/
mmalloc
/
mrealloc.c
diff --git
a/src/xbt/mmalloc/mrealloc.c
b/src/xbt/mmalloc/mrealloc.c
index
82ab876
..
0e03a92
100644
(file)
--- a/
src/xbt/mmalloc/mrealloc.c
+++ b/
src/xbt/mmalloc/mrealloc.c
@@
-55,10
+55,11
@@
void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
switch (type) {
case 0:
/* Maybe reallocate a large block to a small fragment. */
switch (type) {
case 0:
/* Maybe reallocate a large block to a small fragment. */
- if (size <= BLOCKSIZE / 2) {
- //printf("(%s) alloc large block...",xbt_thread_self_name());
+
+ if (size <= BLOCKSIZE / 2) { // Full block -> Fragment; no need to optimize for time
+
result = mmalloc(mdp, size);
result = mmalloc(mdp, size);
- if (result != NULL) {
+ if (result != NULL) {
// useless (mmalloc never returns NULL), but harmless
memcpy(result, ptr, size);
mfree(mdp, ptr);
return (result);
memcpy(result, ptr, size);
mfree(mdp, ptr);
return (result);