|
|
While inline functions speed execution, they may also increase executable sizes, so that as more inlines are added, the time saved by avoiding function linkage is eventually swamped by the increase in text size. We therefore limited our use of inlines to two cases:
Block.h
template <class T> class Block {
private:
unsigned n;
unsigned grow(unsigned);
...
public:
// example of (1)
unsigned size() const { return n; }
// example of (2)
int reserve(unsigned k) {
return k<n || grow(k);
}
...
}