Macaulay2 Engine
Loading...
Searching...
No Matches

◆ gc_vector

template<typename T>
using gc_vector = typename std::vector<T, gc_allocator<T>>

a version of the STL vector, which allocates its backing memory with gc.

This should be used instead of std::vector<T> in the following instances: (1) T contains (or is a pointer to) memory allocated with GC, and (2a) The object containing the vector is in GC collected memory that is, it is in a struct or class inheriting from our_new_delete, or gc_cleanup, or (2b) The vector is in local memory, and has not been allocated on the heap.

It is a (probably hard to detect) error if exactly (1) or (2a) holds. In that case, redesign your class!

Definition at line 76 of file newdelete.hpp.