Commit Graph

2 Commits

Author SHA1 Message Date
Mathias Agopian
8f0591c9a6 cleanup include guards of our public headers
e.g.: the guard for `FooBar.h` should look like:

  TNT_FILAMENT_FOOBAR_H
  TNT_FILAMENT_BACKEND_FOOBAR_H
  TNT_UTILS_FOOBAR_H
2021-08-12 16:55:12 -07:00
Mathias Agopian
6a2c944bbd A fixed capacity vector.
This is (almost) drop-in replacement for std::vector, the main
difference is that FixedCapacityVector has a fixed (at runtime)
capacity, which makes it a lot more efficient and small for operations
like push_back();

The capacity can be set (and re-set) as usual with reserve(),
but exceeding the capacity when adding items will throw.
The capacity is also set when creating the vector with a size.

In addition a FixedCapacityVector<> instance is only 16 bytes instead
of 24 for std::vector<>.

The aim here is to reduce code bloat.
2021-05-27 15:53:53 -07:00