/dovecot/src/lib/ |
H A D | test-mempool-allocfree.c | 7 static bool mem_has_bytes(const void *mem, size_t size, uint8_t b) argument 9 const uint8_t *bytes = mem; 28 void *mem = NULL; local 36 if (mem != NULL) { 37 test_assert_idx(mem_has_bytes(mem, last_alloc, SENSE), i); 42 p_free(pool, mem); 45 if (mem != NULL) 49 mem = p_realloc(pool, mem, last_alloc, i*2); 51 test_assert_idx(mem_has_bytes(mem, last_allo [all...] |
H A D | mempool-system.c | 23 static void *pool_system_realloc(pool_t pool, void *mem, 67 void *mem; local 75 mem = calloc(size, 1); 76 if (unlikely(mem == NULL)) { 84 return mem; 87 void pool_system_free(pool_t pool ATTR_UNUSED, void *mem ATTR_UNUSED) 93 safe_memset(mem, CLEAR_CHR, malloc_usable_size(mem)); 95 free(mem); 102 static void *pool_system_realloc(pool_t pool ATTR_UNUSED, void *mem, argument [all...] |
H A D | imem.h | 9 #define i_realloc_type(mem, type, old_count, new_count) \ 10 p_realloc_type(default_pool, mem, type, old_count, new_count) 13 void *i_realloc(void *mem, size_t old_size, size_t new_size) 16 /* i_free() and i_free_and_null() are now guaranteed to both set mem=NULL, 19 # define i_free(mem) p_free_and_null(default_pool, mem) 21 # define i_free(mem) \ 23 pool_system_free(default_pool, mem); \ 24 (mem) = NULL; \ 27 #define i_free_and_null(mem) i_fre [all...] |
H A D | mempool-unsafe-datastack.c | 11 static void pool_unsafe_data_stack_free(pool_t pool, void *mem); 12 static void *pool_unsafe_data_stack_realloc(pool_t pool, void *mem, 64 void *mem ATTR_UNUSED) 69 void *mem, 78 if (mem == NULL) 82 return mem; 84 if (!t_try_realloc(mem, new_size)) { 86 memcpy(new_mem, mem, old_size); 87 mem = new_mem; 90 memset((char *) mem 68 pool_unsafe_data_stack_realloc(pool_t pool ATTR_UNUSED, void *mem, size_t old_size, size_t new_size) argument [all...] |
H A D | mempool.h | 26 void (*free)(pool_t pool, void *mem); 29 void *(*realloc)(pool_t pool, void *mem, 90 #define p_realloc_type(pool, mem, type, old_count, new_count) \ 91 ((type *) p_realloc(pool, mem, \ 103 p_realloc(pool_t pool, void *mem, size_t old_size, size_t new_size) argument 105 return pool->v->realloc(pool, mem, old_size, new_size); 109 set mem=NULL, so either one of them can be used. */ 110 #define p_free(pool, mem) \ 112 p_free_internal(pool, mem); \ 113 (mem) 117 p_free_internal(pool_t pool, void *mem) argument [all...] |
H A D | test-mempool-alloconly.c | 5 static bool mem_has_bytes(const void *mem, size_t size, uint8_t b) argument 7 const uint8_t *bytes = mem; 24 void *mem[PMALLOC_MAX_COUNT + 1]; local 37 mem[0] = p_malloc(pool, j); 38 memset(mem[0], j, j); 41 mem[k] = p_malloc(pool, k); 42 memset(mem[k], k, k); 47 test_assert(mem_has_bytes(mem[0], j, j)); 49 test_assert(mem_has_bytes(mem[k], k, k));
|
H A D | mempool-datastack.c | 11 static void pool_data_stack_free(pool_t pool, void *mem); 12 static void *pool_data_stack_realloc(pool_t pool, void *mem, 98 static void pool_data_stack_free(pool_t pool, void *mem ATTR_UNUSED) 106 static void *pool_data_stack_realloc(pool_t pool, void *mem, argument 119 if (mem == NULL) 123 return mem; 125 if (!t_try_realloc(mem, new_size)) { 127 memcpy(new_mem, mem, old_size); 128 mem = new_mem; 131 memset((char *) mem [all...] |
H A D | mempool-alloconly.c | 56 static void pool_alloconly_free(pool_t pool, void *mem); 57 static void *pool_alloconly_realloc(pool_t pool, void *mem, 269 void *mem; local 286 mem = POOL_BLOCK_DATA(apool->block) + 292 memcpy(mem, &size, sizeof(size)); 293 mem = PTR_OFFSET(mem, MEM_ALIGN(sizeof(size))); 295 memset(PTR_OFFSET(mem, size), CLEAR_CHR, 298 return mem; 301 static void pool_alloconly_free(pool_t pool, void *mem) argument 315 pool_try_grow(struct alloconly_pool *apool, void *mem, size_t size) argument 334 pool_alloconly_realloc(pool_t pool, void *mem, size_t old_size, size_t new_size) argument [all...] |
H A D | mempool-allocfree.c | 38 static void pool_allocfree_free(pool_t pool, void *mem); 39 static void *pool_allocfree_realloc(pool_t pool, void *mem, 151 pool_block_detach(struct allocfree_pool *apool, unsigned char *mem) argument 153 struct pool_block *block = PTR_OFFSET(mem, -SIZEOF_POOLBLOCK); 156 i_assert(block->block == mem); 185 static void pool_allocfree_free(pool_t pool, void *mem) argument 189 if (mem == NULL) 191 struct pool_block *block = pool_block_detach(apool, mem); 197 static void *pool_allocfree_realloc(pool_t pool, void *mem, argument 207 if (mem [all...] |
H A D | imem.c | 12 void *i_realloc(void *mem, size_t old_size, size_t new_size) argument 14 return p_realloc(default_pool, mem, old_size, new_size);
|
H A D | strfuncs.c | 44 void *mem; local 51 mem = p_malloc(pool, len); 52 memcpy(mem, str, len); 53 return mem; 58 void *mem; local 60 mem = p_malloc(pool, size); 61 memcpy(mem, data, size); 62 return mem; 76 char *mem; local 82 mem 89 char *mem; local [all...] |
H A D | data-stack.c | 464 void *mem; local 466 mem = t_malloc_real(size, TRUE); 467 memset(mem, 0, size); 468 return mem; 471 bool t_try_realloc(void *mem, size_t size) argument 487 if (after_last_alloc - last_alloc_size + debug_adjust == mem) { 495 old_raw_size = *(size_t *)PTR_OFFSET(mem, -(ptrdiff_t)MEM_ALIGN(sizeof(size_t))); 499 i_assert(((unsigned char*)mem)[old_raw_size] == CLEAR_CHR); 513 *(size_t *)PTR_OFFSET(mem, -(ptrdiff_t)MEM_ALIGN(sizeof(size_t))) = size; 514 memset(PTR_OFFSET(mem, siz [all...] |
H A D | data-stack.h | 88 bool t_try_realloc(void *mem, size_t size);
|
H A D | test-mempool.c | 118 static void pool_test_free(pool_t pool ATTR_UNUSED, void *mem ATTR_UNUSED) { } 119 static void *pool_test_realloc(pool_t pool ATTR_UNUSED, void *mem ATTR_UNUSED,
|
/dovecot/src/lib-ssl-iostream/ |
H A D | dovecot-openssl-common.c | 22 void *mem = malloc(size); local 23 if (mem == NULL) { 27 return mem; 36 void *mem = realloc(ptr, size); local 37 if (mem == NULL) { 41 return mem;
|