#pragma once #include #include "threading/sync/lockable.hpp" #include "threading/sync/spinlock.hpp" template class FreeList : Lockable { public: void swap(std::vector &dst) { std::swap(data, dst); } void add(T *element) { auto lock = this->acquire_unique(); data.emplace_back(element); } size_t size() const { return data.size(); } private: std::vector data; };