ucx/mempool.c

changeset 75
990734f548ef
parent 69
fb59270b1de3
child 95
ecfdc1c4a552
equal deleted inserted replaced
74:dc8bade7f2a3 75:990734f548ef
3 */ 3 */
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <inttypes.h>
8 9
9 #include "mempool.h" 10 #include "mempool.h"
10 11
11 typedef struct { 12 typedef struct {
12 ucx_destructor destructor; 13 ucx_destructor destructor;
82 if(pool->data[i] == mem) { 83 if(pool->data[i] == mem) {
83 pool->data[i] = newm; 84 pool->data[i] = newm;
84 return newm + sizeof(ucx_destructor); 85 return newm + sizeof(ucx_destructor);
85 } 86 }
86 } 87 }
87 fprintf(stderr, "FATAL: %8x not in mpool %8x\n", ptr, pool); 88 fprintf(stderr, "FATAL: 0x%08"PRIxPTR" not in mpool 0x%08"PRIxPTR"\n",
89 (intptr_t)ptr, (intptr_t)pool);
88 exit(1); 90 exit(1);
89 } else { 91 } else {
90 return newm + sizeof(ucx_destructor); 92 return newm + sizeof(ucx_destructor);
91 } 93 }
92 } 94 }

mercurial