[FFmpeg-devel] [PATCH] install aes.h, des.h and rc4.h
Reimar Döffinger
Reimar.Doeffinger
Fri Feb 6 23:18:57 CET 2009
On Fri, Feb 06, 2009 at 10:33:00PM +0100, Michael Niedermayer wrote:
> On Fri, Feb 06, 2009 at 09:53:16PM +0100, Reimar D?ffinger wrote:
> > But maybe we can find a better solution.
> > What about a
> > void *av_alloca(uint8_t *);
> > Usage would be
> > uint8_t buffer[size + AV_ALLOCA_PADDING];
> > struct AVAES *a = av_alloca(buffer);
> >
> > Does that seem like it might make a good solution or does it have
> > serious issues?
>
> its not particularely pretty and something should be done to make it
> less error prone, also no function call should happen just a macro
> or inline function
I did intend to make the function static inline.
I think it will always ugly, though maybe something like (untested)
#define AV_STACK_VAR(type, name, size) \
uint8_t name ff_alloca_##name##_buffer[size + 16]; \
type name = ff_alloca_##name##_buffer + ((-(long)ff_alloca_##name##_buffer - 1)&15) + 1;
fits your idea better?
Greetings,
Reimar D?ffinger
More information about the ffmpeg-devel
mailing list