aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/util/address_space.cpp
blob: 67548a506d0d5e35d13c1be9ba81655d37486bcf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "address_space.h"
#include <ostream>
#include <cassert>

namespace vespalib {

AddressSpace::AddressSpace()
    : _used(0),
      _dead(0),
      _limit(0)
{
}

AddressSpace::AddressSpace(size_t used_, size_t dead_, size_t limit_)
    : _used(used_),
      _dead(dead_),
      _limit(limit_)
{
    assert(_used >= _dead);
}

std::ostream &operator << (std::ostream &out, const AddressSpace &rhs)
{
    return out << "{used=" << rhs.used() << ", dead=" << rhs.dead() << ", limit=" << rhs.limit() << "}";
}

} // namespace vespalib