Cast the sizeof() result to unsigned int, because it's definitely always
enough and in many cases this allows optimizing away the wrap-check.
size_t t_get_bytes_available(void) ATTR_PURE;
#define t_new(type, count) \
- ((type *) t_malloc0(sizeof(type) * (count)))
+ ((type *) t_malloc0(MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
+ COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
/* Returns pointer to a temporary buffer you can use. The buffer will be
invalid as soon as next t_malloc() is called!
size_t pool_get_exp_grown_size(pool_t pool, size_t old_size, size_t min_size);
#define p_new(pool, type, count) \
- ((type *) p_malloc(pool, sizeof(type) * (count)))
+ ((type *) p_malloc(pool, MALLOC_MULTIPLY((unsigned int)sizeof(type), (count))) + \
+ COMPILE_ERROR_IF_TRUE(sizeof(type) > UINT_MAX))
static inline void * ATTR_MALLOC ATTR_RETURNS_NONNULL
p_malloc(pool_t pool, size_t size)
{