5#ifndef SPA_POD_DYNAMIC_H
6#define SPA_POD_DYNAMIC_H
13#include <spa/utils/cleanup.h>
22static int spa_pod_dynamic_builder_overflow(
void *
data, uint32_t
size)
25 int32_t old_size = d->
b.
size;
27 void *old_data = d->
b.
data, *new_data;
29 if (old_data == d->
data)
31 if ((new_data = realloc(d->
b.
data, new_size)) == NULL)
33 if (old_data == d->
data && new_data != old_data && old_size > 0)
34 memcpy(new_data, old_data, old_size);
45 .overflow = spa_pod_dynamic_builder_overflow
56 free(builder->
b.
data);
60 spa_pod_dynamic_builder_clean(thing);
static void spa_pod_builder_set_callbacks(struct spa_pod_builder *builder, const struct spa_pod_builder_callbacks *callbacks, void *data)
Definition builder.h:71
#define SPA_POD_BUILDER_INIT(buffer, size)
Definition builder.h:62
#define SPA_VERSION_POD_BUILDER_CALLBACKS
Definition builder.h:47
#define SPA_ROUND_UP_N(num, align)
Definition defs.h:320
void * data
Definition builder.h:54
uint32_t size
Definition builder.h:55
uint32_t extend
Definition dynamic.h:22
uint32_t _padding
Definition dynamic.h:23
struct spa_pod_builder b
Definition dynamic.h:20
void * data
Definition dynamic.h:21