24#ifndef DD_CACHE__FREE_LIST_INCLUDED
25#define DD_CACHE__FREE_LIST_INCLUDED
55 typedef std::vector<E *, Malloc_allocator<E *>>
List_type;
72 assert(element !=
nullptr && element->usage() == 0);
83 assert(element !=
nullptr && element->usage() == 0);
86 for (
typename List_type::iterator it =
m_list.begin(); it !=
m_list.end();
115 fprintf(stderr,
" lru-> NULL\n");
118 fprintf(stderr,
" lru-> ");
119 for (
typename List_type::const_iterator it =
m_list.begin();
121 fprintf(stderr,
"%llu ", (*it)->object()->id());
122 fprintf(stderr,
"\n");
Malloc_allocator is a C++ STL memory allocator based on my_malloc/my_free.
Definition: malloc_allocator.h:63
Template for management of a free list based on a std::vector.
Definition: free_list.h:53
void dump() const
Debug dump of the free list to stderr.
Definition: free_list.h:112
List_type m_list
Definition: free_list.h:56
void remove(E *element)
Remove an element from the free list.
Definition: free_list.h:82
std::vector< E *, Malloc_allocator< E * > > List_type
Definition: free_list.h:55
Free_list()
Definition: free_list.h:59
size_t length() const
Definition: free_list.h:63
void add_last(E *element)
Add an element to the end of the free list.
Definition: free_list.h:71
E * get_lru() const
Get the least recently used element in the list, i.e., the first element.
Definition: free_list.h:102
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
PSI_memory_key key_memory_DD_cache_infrastructure
Definition: psi_memory_key.cc:37