/* Support for an sbrk-like function that uses mmap. */
-/* Copyright (c) 2010-2019. The SimGrid Team.
+/* Copyright (c) 2010-2020. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
/* We are deallocating memory. If the amount requested would cause us to try to deallocate back past the base of
* the mmap'd region then die verbosely. Otherwise, deallocate the memory and return the old break value. */
if (((char*)mdp->breakval) + size >= (char*)mdp->base) {
- result = (void*)mdp->breakval;
+ result = mdp->breakval;
mdp->breakval = (char*)mdp->breakval + size;
moveto = PAGE_ALIGN(mdp->breakval);
munmap(moveto, (size_t)(((char*)mdp->top) - ((char*)moveto)) - 1);
mdp->base = mdp->breakval = mapto;
mdp->top = PAGE_ALIGN((char*)mdp->breakval + size);
- result = (void *) mdp->breakval;
+ result = mdp->breakval;
mdp->breakval = (char*)mdp->breakval + size;
} else {
/* Memory is already mapped, we only need to increase the breakval: */
- result = (void *) mdp->breakval;
+ result = mdp->breakval;
mdp->breakval = (char*)mdp->breakval + size;
}
}