cessen / ropey

A utf8 text rope for manipulating and editing large texts.
MIT License
1.04k stars 46 forks source link

Add methods for manual memory-overhead management #6

Closed cessen closed 6 years ago

cessen commented 6 years ago

Although ideally memory overhead would be minimal all the time, in practice there will always be some memory overhead from manipulating ropes, much like Vecs which allocate more capacity than their contents when pushing to them.

Let's add methods analogous to capacity() and shrink_to_fit() from Vec, which could be useful in some situations.

cessen commented 6 years ago

Added in 7349deb34a422479aebe99af7b8a4cdeda6443a4.