James Almer (12020-08-10): > 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 exactly what the code does, except without the undefined behaviors, because what you just wrote is completely invalid. > And i *really* want to emphasize just how cold this function is, > especially ever since av_bsf_flush() was introduced, and even more so if > av_bsf_close() is also committed. You missed the part where Andreas said this was a proof of concept, and the same should be done for all similar cases. IIRC, you like consistency. > Skipping a 12 byte allocation does nothing on any system with a C > library worth its salt, where it will be cached and ready to be returned > by malloc. It does save some memory. > Can we not get overtly clever with code obfuscation? There is no obfuscation, just a very standard an common practice. Regards, -- Nicolas George
signature.asc
Description: PGP signature
_______________________________________________ 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".