ide-tape: improve buffer allocation strategy