MCPcopy Create free account
hub / github.com/boostorg/asio / alloc

Method alloc

include/boost/asio/detail/object_pool.hpp:65–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 // Allocate a new object with an argument.
64 template <typename... Args>
65 Object* alloc(Args... args)
66 {
67 Object* o = free_list_;
68 if (o)
69 free_list_ = free_list_->next_;
70 else
71 o = allocate_object<Object>(allocator_, args...);
72
73 o->next_ = live_list_;
74 o->prev_ = 0;
75 if (live_list_)
76 live_list_->prev_ = o;
77 live_list_ = o;
78
79 return o;
80 }
81
82 // Free an object. Moves it to the free list. No destructors are run.
83 void free(Object* o)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected