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
[SMPI] Replay: Cosmetics
[simgrid.git]
/
src
/
xbt
/
mmalloc
/
mrealloc.c
diff --git
a/src/xbt/mmalloc/mrealloc.c
b/src/xbt/mmalloc/mrealloc.c
index 589e412012cb4372979d4cec9efb8b58beea03df..aabf868be68463d71d035f8c7cc0c7a0e92d331a 100644
(file)
--- a/
src/xbt/mmalloc/mrealloc.c
+++ b/
src/xbt/mmalloc/mrealloc.c
@@
-22,7
+22,6
@@
void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
{
void *result;
size_t blocks;
- size_t oldlimit;
/* Only keep real realloc, and reroute hidden malloc and free to the relevant functions */
if (size == 0) {
@@
-37,9
+36,7
@@
void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
if ((char *) ptr < (char *) mdp->heapbase || BLOCK(ptr) > mdp->heapsize) {
printf("FIXME. Ouch, this pointer is not mine, refusing to proceed (another solution would be to malloc "
"it instead of reallocing it, see source code)\n");
- result = mmalloc(mdp, size);
abort();
- return result;
}
size_t requested_size = size; // The amount of memory requested by user, for real
@@
-92,8
+89,7
@@
void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
mdp->heapinfo[it].busy_block.busy_size = 0;
}
- mdp->heapinfo[block + blocks].busy_block.size
- = mdp->heapinfo[block].busy_block.size - blocks;
+ mdp->heapinfo[block + blocks].busy_block.size = mdp->heapinfo[block].busy_block.size - blocks;
mfree(mdp, ADDRESS(block + blocks));
mdp->heapinfo[block].busy_block.size = blocks;
@@
-115,7
+111,7
@@
void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
action for obvious reasons. */
blocks = mdp->heapinfo[block].busy_block.size;
/* Prevent free from actually returning memory to the system. */
- oldlimit = mdp->heaplimit;
+
size_t
oldlimit = mdp->heaplimit;
mdp->heaplimit = 0;
mfree(mdp, ptr);
mdp->heaplimit = oldlimit;