in the size parameter. If return value doesn't point to the same value
as last time, you need to memcpy() data from the old buffer to the
new one (or do some other trickery). See t_buffer_reget(). */
-#define t_buffer_get_type(type, size) \
- t_buffer_get(sizeof(type) * (size))
void *t_buffer_get(size_t size) ATTR_RETURNS_NONNULL;
/* Grow the buffer, memcpy()ing the memory to new location if needed. */
-#define t_buffer_reget_type(buffer, type, size) \
- t_buffer_reget(buffer, sizeof(type) * (size))
void *t_buffer_reget(void *buffer, size_t size) ATTR_RETURNS_NONNULL;
/* Make the last t_buffer_get()ed buffer permanent. Note that size MUST be
less or equal than the size you gave with last t_buffer_get() or the
result will be undefined. */
-#define t_buffer_alloc_type(type, size) \
- t_buffer_alloc(sizeof(type) * (size))
void t_buffer_alloc(size_t size);
/* Allocate the last t_buffer_get()ed data entirely. */
void t_buffer_alloc_last_full(void);
char tag[2] = { depth+1, '\0' };
int try_fails = 0;
data_stack_frame_t t_id = t_push_named("test_ds_recurse[%i]", depth);
- ps = t_buffer_get_type(char *, number);
+ ps = t_buffer_get(sizeof(char *) * number);
i_assert(ps != NULL);
- t_buffer_alloc_type(char *, number);
+ t_buffer_alloc(sizeof(char *) * number);
for (i = 0; i < number; i++) {
ps[i] = t_malloc_no0(size/2);