NULL, 0);
}
- htb = rspamd_mempool_alloc0 (pool, sizeof (*htb));
+ htb = rspamd_mempool_alloc0_type(pool, struct rspamd_hash_map_helper);
htb->htb = kh_init (rspamd_map_hash);
htb->pool = pool;
htb->map = map;
NULL, 0);
}
- r = rspamd_mempool_alloc0 (pool, sizeof (*r));
+ r = rspamd_mempool_alloc0_type (pool, struct rspamd_radix_map_helper);
r->trie = radix_create_compressed_with_pool (pool, name);
r->htb = kh_init (rspamd_map_hash);
r->pool = pool;
pool = rspamd_mempool_new (rspamd_mempool_suggest_size (),
map->tag, 0);
- re_map = rspamd_mempool_alloc0 (pool, sizeof (*re_map));
+ re_map = rspamd_mempool_alloc0_type (pool, struct rspamd_regexp_map_helper);
re_map->pool = pool;
re_map->values = g_ptr_array_new ();
re_map->regexps = g_ptr_array_new ();
#define rspamd_mempool_alloc(pool, size) \
rspamd_mempool_alloc_((pool), (size), MIN_MEM_ALIGNMENT, (G_STRLOC))
#define rspamd_mempool_alloc_type(pool, type) \
- (type *)(rspamd_mempool_alloc_((pool), sizeof(type), RSPAMD_ALIGNOF(type), (G_STRLOC)))
+ (type *)(rspamd_mempool_alloc_((pool), sizeof(type), \
+ MAX(MIN_MEM_ALIGNMENT, RSPAMD_ALIGNOF(type)), (G_STRLOC)))
#define rspamd_mempool_alloc_buffer(pool, buflen) \
(char *)(rspamd_mempool_alloc_((pool), sizeof(char) * (buflen), MIN_MEM_ALIGNMENT, (G_STRLOC)))
/**
#define rspamd_mempool_alloc0(pool, size) \
rspamd_mempool_alloc0_((pool), (size), MIN_MEM_ALIGNMENT, (G_STRLOC))
#define rspamd_mempool_alloc0_type(pool, type) \
- (type *)(rspamd_mempool_alloc0_((pool), sizeof(type), RSPAMD_ALIGNOF(type), (G_STRLOC)))
+ (type *)(rspamd_mempool_alloc0_((pool), sizeof(type), \
+ MAX(MIN_MEM_ALIGNMENT, RSPAMD_ALIGNOF(type)), (G_STRLOC)))
/**
* Make a copy of string in pool