Use a cursor object instead of array slicing
Use a cursor object instead of array slicing

This makes generating flamegraph HTML faster by avoid copying data and
instead creating objects to track the windows inside the buffer.

tmm1/stackprof,tmm1/stackprof,tmm1/stackprof,tmm1/stackprof