23 #ifndef _MEMORY_PRIVATE_ALLOCATOR_HPP_ 24 #define _MEMORY_PRIVATE_ALLOCATOR_HPP_ 88 inline const_pointer
address (const_reference r)
94 inline pointer allocate (size_type
count);
95 inline void deallocate (pointer
p, size_type ignored = 0);
98 size_type max_size ()
const;
101 inline void construct (pointer p, const_reference t);
102 inline void destroy (pointer p);
106 HL_HEAPID get_heapid ()
const;
115 template <
typename T,
typename U>
122 template <
typename T,
typename U>
145 inline void operator () (T *ptr)
const;
159 inline T *
get ()
const;
160 inline T *release ();
164 inline void reset (T *ptr);
166 inline T *operator-> ()
const;
167 inline T &operator* ()
const;
176 template <
typename Func,
typename ...Args>
192 template <
typename T>
194 : m_thread_p (thread_p)
200 template <
typename T>
208 template <
typename T>
209 template <
typename U>
217 template <
typename T>
223 template <
typename T>
230 template <
typename T>
238 template <
typename T>
242 const size_type DB_PRIVATE_ALLOCATOR_MAX_SIZE = 0x7FFFFFFF;
243 return DB_PRIVATE_ALLOCATOR_MAX_SIZE /
sizeof (T);
246 template <
typename T>
253 template <
typename T>
260 template <
typename T>
267 template <
typename T>
285 : thread_p (thread_p)
312 return m_smart_ptr.get ();
318 return m_smart_ptr.release ();
332 m_smart_ptr.reset (ptr);
339 return m_smart_ptr.get ();
346 return *m_smart_ptr.get ();
349 template <
typename Func,
typename...Args >
358 func (std::forward < Args > (args)...);
367 #endif // _MEMORY_PRIVATE_ALLOCATOR_HPP_ void deregister_private_allocator(cubthread::entry *thread_p)
std::unique_ptr< T, private_pointer_deleter< T > > m_smart_ptr
HL_HEAPID get_heapid() const
const value_type * const_pointer
cubthread::entry * get_thread_entry() const
const value_type & const_reference
void private_heap_deallocate(cubthread::entry *thread_p, HL_HEAPID heapid, void *ptr)
void construct(pointer p, const_reference t)
pointer address(reference r)
bool operator==(const private_allocator< T > &, const private_allocator< U > &)
private_allocator< U > other
void * private_heap_allocate(cubthread::entry *thread_p, HL_HEAPID heapid, size_t size)
const block_allocator PRIVATE_BLOCK_ALLOCATOR
HL_HEAPID db_change_private_heap(THREAD_ENTRY *thread_p, HL_HEAPID heap_id)
void switch_to_global_allocator_and_call(Func &&func, Args &&...args)
size_type max_size() const
bool operator!=(const private_allocator< T > &, const private_allocator< U > &)
cubthread::entry * thread_p
pointer allocate(size_type count)
private_allocator(cubthread::entry *thread_p=NULL)
#define db_private_free(thrd, ptr)
HL_HEAPID get_private_heapid(cubthread::entry *&thread_p)
void register_private_allocator(cubthread::entry *thread_p)
int count(int &result, const cub_regex_object ®, const std::string &src, const int position, const INTL_CODESET codeset)
void deallocate(pointer p, size_type ignored=0)
void swap(private_unique_ptr< T > &other)
private_unique_ptr(T *ptr, cubthread::entry *thread_p)
private_pointer_deleter()
ptrdiff_t difference_type
void operator()(T *ptr) const
cubthread::entry * m_thread_p
const_pointer address(const_reference r)