[buffer] Move from extensions to algorithms/detail