Hi everyone - I'm working a static allocation model for Tremor for an embedded project. I'm moved most of the allocations to a static memory structure inside OggVorbis_File except for dec_table which remains mapped to the pseudo-allocator which was posted here a couple months ago. The order of data in dec_table is such that it's hard to make an optimal static memory structure so I just allow the allocator to handle that portion of the memory management. Anyways, one problem I have is that my test vectors don't cause execution to reach every place where there is a malloc/calloc/alloca (I know alloca is stack but I need to protect that from growth too) so I can't profile and remove them from the code. Can anyone tell me if these locations are ever reached/what version/setup of Ogg encoder I would need to use to hit these specific alloc calls?<br>
<br>codebook.c:<br>s->dec_table=_ogg_malloc((s->used_entries*2+1)*sizeof(*work), vf); // near start of make_decode_table<br>s->q_val=_ogg_malloc(quantvals, vf); // near decision to use dec_type 2 in vorbis_book_unpack()<br>
s->q_val=_ogg_malloc(quantvals*2, vf); // just after the call above that is missed<br>s->q_val=_ogg_malloc(s->q_pack*s->used_entries, vf); // near decision to use dec_type 3<br>ogg_int32_t *v = (ogg_int32_t *)alloca(sizeof(*v)*book->dim); // near start of vorbis_book_decodevs_add()<br>
ogg_int32_t *v = (ogg_int32_t *)alloca(sizeof(*v)*book->dim); // near start of vorbis_book_decodev_add()<br>ogg_int32_t *v = (ogg_int32_t *)alloca(sizeof(*v)*book->dim); // near start of vorbis_book_decodev_set()<br>
<br>res012.c<br>**partword=(char **)alloca(ch*sizeof(*partword)); // in res_inverse() if info->type<2<br>partword[j]=(char *)alloca(partwords*partitions_per_word*sizeof(*partword[j])); // in res_inverse() if info->type<2<br>
<br>Lastly, what version of the Ogg encoder uses floor0?<br><br>Thanks everyone!<br><br>Ethan<br>