Optimized buffer allocation in multicore platforms