ucx/mempool.c

changeset 248
dff45a2234ce
parent 242
a3597d704421
child 250
b7d1317b138e
equal deleted inserted replaced
247:ecd242949641 248:dff45a2234ce
113 if (newcap < pool->size || ucx_mempool_chcap(pool, newcap)) { 113 if (newcap < pool->size || ucx_mempool_chcap(pool, newcap)) {
114 return NULL; 114 return NULL;
115 } 115 }
116 } 116 }
117 117
118 ucx_memchunk *mem = (ucx_memchunk*)malloc(sizeof(ucx_destructor) + n); 118 void *p = malloc(sizeof(ucx_destructor) + n);
119 ucx_memchunk *mem = (ucx_memchunk*)p;
119 if (!mem) { 120 if (!mem) {
120 return NULL; 121 return NULL;
121 } 122 }
122 123
123 mem->destructor = NULL; 124 mem->destructor = NULL;

mercurial