11 #ifndef ASIO_DETAIL_THREAD_INFO_BASE_HPP 12 #define ASIO_DETAIL_THREAD_INFO_BASE_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 39 ::operator
delete(reusable_memory_);
44 if (this_thread && this_thread->reusable_memory_)
46 void*
const pointer = this_thread->reusable_memory_;
47 this_thread->reusable_memory_ = 0;
49 unsigned char*
const mem =
static_cast<unsigned char*
>(pointer);
50 if (static_cast<std::size_t>(mem[0]) >= size)
56 ::operator
delete(pointer);
59 void*
const pointer = ::operator
new(size + 1);
60 unsigned char*
const mem =
static_cast<unsigned char*
>(pointer);
61 mem[size] = (size <= UCHAR_MAX) ? static_cast<unsigned char>(size) : 0;
66 void* pointer, std::size_t size)
68 if (size <= UCHAR_MAX)
70 if (this_thread && this_thread->reusable_memory_ == 0)
72 unsigned char*
const mem =
static_cast<unsigned char*
>(pointer);
74 this_thread->reusable_memory_ = pointer;
79 ::operator
delete(pointer);
83 void* reusable_memory_;
91 #endif // ASIO_DETAIL_THREAD_INFO_BASE_HPP static void deallocate(thread_info_base *this_thread, void *pointer, std::size_t size)
static void * allocate(thread_info_base *this_thread, std::size_t size)