set minimum capacity to one if it's zero in Segment constructor

Allocating an empty Segment causes problems for later computations, so
we avoid it even if the caller would otherwise permit it.
This commit is contained in:
Joel Dice 2011-08-10 21:30:55 -06:00
parent e5a8d5c824
commit 39cffb8933

View File

@ -346,6 +346,10 @@ class Segment {
map(map)
{
if (desired) {
if (minimum == 0) {
minimum = 1;
}
assert(context, desired >= minimum);
capacity_ = desired;