Revert "Use linked list for buffer"

This reverts commit 460fe063b6e68a36ad81b3c6832cd35f1c118ef4.