Lines Matching refs:T
59 template <class T>
61 static_assert(std::is_trivially_destructible<T>::value, in alloc()
70 template <class T, typename... Params>
71 T* create(Params&&... params) { in create()
72 T* ret = new (allocImpl(sizeof(T))) T(std::forward<Params>(params)...); in create()
73 if (!std::is_trivially_destructible<T>::value) { in create()
74 auto dtor = [](void* ret) { ((T*)ret)->~T(); }; in create()
80 template <class T, typename... Params>
81 T* create_trivial(Params&&... params) { in create_trivial()
82 static_assert(std::is_trivially_destructible<T>::value, in create_trivial()
84 return new (allocImpl(sizeof(T))) T(std::forward<Params>(params)...); in create_trivial()
87 template <class T>
88 T* create_trivial_array(int count) { in create_trivial_array()
89 static_assert(std::is_trivially_destructible<T>::value, in create_trivial_array()
91 return reinterpret_cast<T*>(allocImpl(sizeof(T) * count)); in create_trivial_array()
103 template <class T>
104 void rewindIfLastAlloc(T* ptr) { in rewindIfLastAlloc()
105 rewindIfLastAlloc((void*)ptr, sizeof(T)); in rewindIfLastAlloc()
155 template <class T>
158 typedef T value_type; // needed to implement std::allocator
159 typedef T* pointer; // needed to implement std::allocator
175 T* allocate(size_t num, const void* = 0) {
176 return (T*)(linearAllocator.alloc<void*>(num * sizeof(T)));
181 linearAllocator.rewindIfLastAlloc(p, num * sizeof(T)); in deallocate()
198 template <class T>
199 class LsaVector : public std::vector<T, LinearStdAllocator<T>> {
201 explicit LsaVector(const LinearStdAllocator<T>& allocator) in LsaVector()
202 : std::vector<T, LinearStdAllocator<T>>(allocator) {} in LsaVector()