On Mon, Apr 21, 2014 at 7:05 PM, Ivan Zhakov <i...@visualsvn.com> wrote:
> Hi Stefan, > > It's good time to make consistent in either way. > I agree that consistency is a goal in itself since it improves maintainability (principle of least surprise). That does not mean it would trump other goals, but its utility extends far beyond mere aesthetics. Where temporary read buffers should be allocated: on stack or in heap > (pool)? I'm fine with both approaches, but I would like to make it > consistent. What do you think? > I'd love to see them all allocated on stack but there is a problem: the 3-way comparison functions use 3 of these buffers at a time which translates to ~200k stack memory. You can't do that too often in a 1M stack that is the default in VisualStudio, IIRC. Since it is conceivable that we would like to increase the buffer size even further in certain functions at some point in the future, stack allocation is not future proof. So, +1 on allocation in pools. Exceptions should not be frowned upon but require a specific rationale. -- Stefan^2.