EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
Loading...
Searching...
No Matches
Allocation

Storage sized by a space never touches the heap when the space is fixed or bounded (see Spaces), and an unbounded space allocates through Eigen's ordinary heap path. More...

Classes

struct  Emrys::Capacity
 The most elements a container will hold, reserved once: a mixture's components or a particle set's particles. More...

Typedefs

using Emrys::DefaultAllocator = std::allocator<std::byte>
 The allocator a type with a run-time count uses unless given one.

Detailed Description

Storage sized by a space never touches the heap when the space is fixed or bounded (see Spaces), and an unbounded space allocates through Eigen's ordinary heap path.

Storage sized by a run-time count of elements, such as a mixture's components or a particle set's particles, belongs on the heap under the caller's control:

  • every type with a run-time count takes an Allocator template parameter after its scalar, DefaultAllocator unless given, with allocator_type, get_allocator(), and an allocator-extended overload of every constructor. A std::pmr::polymorphic_allocator<> is such an allocator, so memory resources need nothing more;
  • a type made from an existing one (a copy, a view's copy(), a filter's state, the result of a merge or a resample) takes the source's allocator. A copy constructor keeps the source's capacity too, and its scratch's, rather than taking what std::allocator_traits::select_on_container_copy_construction() gives, which for a std::pmr::polymorphic_allocator is the default resource. A copy therefore lives on its source's resource and must not outlive it; the allocator-extended copy constructor puts it elsewhere. Copy assignment keeps the destination's allocator;
  • a type given a Capacity reserves it once, and growing past it is a precondition violation;
  • scratch sized by a count comes from the same allocator and is reused across calls, so a filter's steps allocate nothing once it has run one.