Simple optimization on the buffer allocation