144 test[0] = 5; test[1] = (intptr_t) cb; |
144 test[0] = 5; test[1] = (intptr_t) cb; |
145 *cb = 13; |
145 *cb = 13; |
146 |
146 |
147 ucx_mempool_set_destr(test, test_setdestr); |
147 ucx_mempool_set_destr(test, test_setdestr); |
148 |
148 |
149 int *rtest, n = 2; |
149 intptr_t *rtest, n = 2; |
150 do { |
150 do { |
151 n *= 2; |
151 n *= 2; |
152 UCX_TEST_ASSERT(n < 65536, "test corrupt - no movement for realloc"); |
152 UCX_TEST_ASSERT(n < 65536, "test corrupt - no movement for realloc"); |
153 rtest = ucx_mempool_realloc(pool, test, n*sizeof(intptr_t)); |
153 rtest = (intptr_t*) ucx_mempool_realloc(pool, test, n*sizeof(intptr_t)); |
154 } while (rtest == test); |
154 } while (rtest == test); |
155 test = rtest; |
155 test = rtest; |
156 |
156 |
157 UCX_TEST_ASSERT(*(ucx_destructor*)(pool->data[1]) == test_setdestr, |
157 UCX_TEST_ASSERT(*(ucx_destructor*)(pool->data[1]) == test_setdestr, |
158 "realloc killed destructor") |
158 "realloc killed destructor") |