I modified my code to rely on ffmpeg's av_malloc's functions and I am
now seeing what appears to be memory fragmentation on the Linux platform.
My code is C++ using operator new[], like the following:
struct aligned16_uint8_t
{
uint8_t x;
inline void* operator new(size_t size)
{
void* ptr = av_malloc( size );
if (!ptr) throw std::bad_alloc();
return ptr;
}
inline void operator delete( void* ptr )
{
av_free( ptr );
}
inline void* operator new[](size_t size)
{
void* ptr = av_malloc_array( size, sizeof(aligned16_uint8_t) );
if (!ptr) throw std::bad_alloc();
return ptr;
}
inline void operator delete[]( void* ptr )
{
av_free( ptr );
}
};
The above works fine on Windows and Mac, but on Linux it seems like it
leaks memory / fragments it. Looking at the av_malloc implementation
for Linux, I saw it relies on posix_memalign, but nothing else seems
differently.
--
Gonzalo Garramuño
_______________________________________________
Libav-user mailing list
Libav-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/libav-user
To unsubscribe, visit link above, or email
libav-user-requ...@ffmpeg.org with subject "unsubscribe".