summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
46d57c3)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7714
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
__mmalloc_free (struct mdesc *mdp, void *ptr)
{
int type;
__mmalloc_free (struct mdesc *mdp, void *ptr)
{
int type;
- size_t block;//, blocks; unused variable?
register size_t i;
struct list *prev, *next;
register size_t i;
struct list *prev, *next;
- printf("(%s)realloc %p to %d...",xbt_thread_self_name(),ptr,(int)size);
- if ((char*)ptr < (char*)mdp->heapbase || BLOCK(ptr) > mdp->heapsize ) {
+ //printf("(%s)realloc %p to %d...",xbt_thread_self_name(),ptr,(int)size);
- printf("FIXME. Ouch, this pointer is not mine. I will malloc it instead of reallocing it.\n");
+ if ((char*)ptr < (char*)mdp->heapbase || BLOCK(ptr) > mdp->heapsize ) {
+ printf("FIXME. Ouch, this pointer is not mine. I will malloc it instead of reallocing it. (please report this bug)\n");
result = mmalloc(md,size);
abort();
return result;
result = mmalloc(md,size);
abort();
return result;
if (size <= BLOCKSIZE / 2)
{
UNLOCK(mdp);
if (size <= BLOCKSIZE / 2)
{
UNLOCK(mdp);
- printf("(%s) alloc large block...",xbt_thread_self_name());
+ //printf("(%s) alloc large block...",xbt_thread_self_name());
result = mmalloc (md, size);
if (result != NULL)
{
result = mmalloc (md, size);
if (result != NULL)
{
if (blocks < mdp -> heapinfo[block].busy.info.size)
{
/* The new size is smaller; return excess memory to the free list. */
if (blocks < mdp -> heapinfo[block].busy.info.size)
{
/* The new size is smaller; return excess memory to the free list. */
- printf("(%s) return excess memory...",xbt_thread_self_name());
+ //printf("(%s) return excess memory...",xbt_thread_self_name());
mdp -> heapinfo[block + blocks].busy.type = 0;
mdp -> heapinfo[block + blocks].busy.info.size
= mdp -> heapinfo[block].busy.info.size - blocks;
mdp -> heapinfo[block + blocks].busy.type = 0;
mdp -> heapinfo[block + blocks].busy.info.size
= mdp -> heapinfo[block].busy.info.size - blocks;
to base two of the fragment size. */
if (size > (size_t) (1 << (type - 1)) && size <= (size_t) (1 << type)) {
/* The new size is the same kind of fragment. */
to base two of the fragment size. */
if (size > (size_t) (1 << (type - 1)) && size <= (size_t) (1 << type)) {
/* The new size is the same kind of fragment. */
- printf("(%s) new size is same kind of fragment...",xbt_thread_self_name());
+ //printf("(%s) new size is same kind of fragment...",xbt_thread_self_name());
result = ptr;
} else {
/* The new size is different; allocate a new space,
and copy the lesser of the new size and the old. */
result = ptr;
} else {
/* The new size is different; allocate a new space,
and copy the lesser of the new size and the old. */
- printf("(%s) new size is different...",xbt_thread_self_name());
+ //printf("(%s) new size is different...",xbt_thread_self_name());
UNLOCK(mdp);
result = mmalloc (md, size);
UNLOCK(mdp);
result = mmalloc (md, size);
- printf("(%s) Done reallocing: %p\n",xbt_thread_self_name(),result);fflush(stdout);
+ //printf("(%s) Done reallocing: %p\n",xbt_thread_self_name(),result);fflush(stdout);
/* let this thread wait for the child so that the main thread can detect the timeout without blocking on the wait */
got_pid = waitpid(rctx->pid, &rctx->status, 0);
if (got_pid != rctx->pid) {
/* let this thread wait for the child so that the main thread can detect the timeout without blocking on the wait */
got_pid = waitpid(rctx->pid, &rctx->status, 0);
if (got_pid != rctx->pid) {
- perror(bprintf("(%s) Cannot wait for the child %s (got pid %d where pid %d were expected;rctx=%p;status=%d)",
- xbt_thread_self_name(), rctx->cmd, (int)got_pid, (int)rctx->pid,rctx,rctx->status));
+ perror(bprintf("(%s) Cannot wait for the child %s (got pid %d where pid %d were expected;status=%d)",
+ xbt_thread_self_name(), rctx->cmd, (int)got_pid, (int)rctx->pid,rctx->status));
ERROR1("Test suite `%s': NOK (system error)", testsuite_name);
rctx_armageddon(rctx, 4);
return NULL;
ERROR1("Test suite `%s': NOK (system error)", testsuite_name);
rctx_armageddon(rctx, 4);
return NULL;