ucx/mempool.c

changeset 28
1666cbeb1db8
parent 17
2e7050c3a18e
child 48
621a4430c404
     1.1 --- a/ucx/mempool.c	Sat Feb 18 18:36:30 2012 +0100
     1.2 +++ b/ucx/mempool.c	Mon Feb 20 15:30:45 2012 +0100
     1.3 @@ -75,20 +75,20 @@
     1.4  }
     1.5  
     1.6  void *ucx_mempool_realloc(UcxMempool *pool, void *ptr, size_t n) {
     1.7 -    void *mem = ((char*)ptr) - sizeof(ucx_destructor);
     1.8 +    char *mem = ((char*)ptr) - sizeof(ucx_destructor);
     1.9      char *newm = (char*) realloc(mem, n + sizeof(ucx_destructor));
    1.10      if (newm == NULL) return NULL;
    1.11      if (mem != newm) {
    1.12          for(int i=0;i<pool->ndata;i++) {
    1.13              if(pool->data[i] == mem) {
    1.14                  pool->data[i] = newm;
    1.15 -                return ((char*) newm) + sizeof(ucx_destructor);
    1.16 +                return newm + sizeof(ucx_destructor);
    1.17              }
    1.18          }
    1.19 -        fprintf(stderr, "FATAL: %8x not in mpool %8x\n", mem, pool);
    1.20 +        fprintf(stderr, "FATAL: %8x not in mpool %8x\n", ptr, pool);
    1.21          exit(1);
    1.22      } else {
    1.23 -        return ((char*) newm) + sizeof(ucx_destructor);
    1.24 +        return newm + sizeof(ucx_destructor);
    1.25      }
    1.26  }
    1.27  

mercurial