mallocs in libav style, THREADS define , slice static