25#ifndef SPA_POD_DYNAMIC_H
26#define SPA_POD_DYNAMIC_H
41static int spa_pod_dynamic_builder_overflow(
void *
data, uint32_t
size)
44 int32_t old_size = d->
b.
size;
46 void *old_data = d->
b.
data;
48 if (old_data == d->
data)
50 if ((d->
b.
data = realloc(d->
b.
data, new_size)) == NULL)
52 if (old_data == d->
data && d->
b.
data != old_data && old_size > 0)
53 memcpy(d->
b.
data, old_data, old_size);
63 .overflow = spa_pod_dynamic_builder_overflow
74 free(builder->
b.
data);
static void spa_pod_builder_set_callbacks(struct spa_pod_builder *builder, const struct spa_pod_builder_callbacks *callbacks, void *data)
Definition: builder.h:91
#define SPA_POD_BUILDER_INIT(buffer, size)
Definition: builder.h:82
#define SPA_VERSION_POD_BUILDER_CALLBACKS
Definition: builder.h:67
#define SPA_ROUND_UP_N(num, align)
Definition: defs.h:336
void * data
Definition: builder.h:74
uint32_t size
Definition: builder.h:75
uint32_t extend
Definition: dynamic.h:41
uint32_t _padding
Definition: dynamic.h:42
struct spa_pod_builder b
Definition: dynamic.h:39
void * data
Definition: dynamic.h:40