* Avery Pennarun <apenw...@gmail.com> [2009-11-10 17:34]: > might or might not result in the array being reallocated even in the > *naive* implementation. Each reallocation will cause a copy of the > entire buffer every time. > > Conversely, a chunked implementation would reallocate-and-copy the > data at most once, when you call GetBuffer(). So it is strictly > equal-or-better than the naive implementation, in terms of > reallocations and copies.
Yes, it's true, but only partially. Code that knows how naive is MemoryStream could absorb the reallocations, maybe in some backgroud work. And the assume that GetBuffer is instantaneous (in GUI thread). (Yes, this is purely academic point; No, I don't have such code; No, I haven't seen one). greets silk _______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list