Andreas Rheinhardt: > James Almer: >> On 8/10/2020 7:11 PM, Nicolas George wrote: >>> James Almer (12020-08-10): >>>> Personally, i don't like it. It's extra complexity to save a single 8 or >>>> 12 byte allocation that happens once during bsf alloc. It's kind of a >>>> pointless micro-optimization. >>> >>> I do not agree at all. >>> >>> First, it is not extra complexity, it actually makes the code simpler: >>> less mutually dependant allocations that can lead to leaks if they are >>> not handled properly, better guarantees, for no more code. >> >> It adds an extra struct and makes the code harder to read. Might as well >> just do >> >> ctx = av_mallocz(sizeof(*ctx) + sizeof(AVBSFInternal)); >> ctx->internal = &ctx[1]; > > This is not ok due to padding/alignment. > Forgot to mention that you are also circumventing the type system whereas my version doesn't.
- Andreas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".