MCPcopy Create free account
hub / github.com/MariaDB/server / acquire_buffer

Method acquire_buffer

sql/threadpool_winsockets.cc:96–104  ·  view source on GitHub ↗

Returns a buffer, or NULL if no free buffers. LIFO policy is implemented, so we do not touch too many pages (no std::stack though) */

Source from the content-addressed store, hash-verified

94 pages (no std::stack though)
95*/
96char *AIO_buffer_cache::acquire_buffer()
97{
98 std::unique_lock<std::mutex> lk(m_mtx);
99 if (m_cache.empty())
100 return nullptr;
101 auto p= m_cache.back();
102 m_cache.pop_back();
103 return p;
104}
105
106void AIO_buffer_cache::release_buffer(char *v)
107{

Callers 1

initMethod · 0.80

Calls 3

emptyMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected