23#ifndef DD_CACHE__FREE_LIST_INCLUDED
24#define DD_CACHE__FREE_LIST_INCLUDED
54 typedef std::vector<E *, Malloc_allocator<E *>>
List_type;
71 assert(element !=
nullptr && element->usage() == 0);
82 assert(element !=
nullptr && element->usage() == 0);
85 for (
typename List_type::iterator it =
m_list.begin(); it !=
m_list.end();
114 fprintf(stderr,
" lru-> NULL\n");
117 fprintf(stderr,
" lru-> ");
118 for (
typename List_type::const_iterator it =
m_list.begin();
120 fprintf(stderr,
"%llu ", (*it)->object()->id());
121 fprintf(stderr,
"\n");
Malloc_allocator is a C++ STL memory allocator based on my_malloc/my_free.
Definition: malloc_allocator.h:62
Template for management of a free list based on a std::vector.
Definition: free_list.h:52
void dump() const
Debug dump of the free list to stderr.
Definition: free_list.h:111
List_type m_list
Definition: free_list.h:55
void remove(E *element)
Remove an element from the free list.
Definition: free_list.h:81
std::vector< E *, Malloc_allocator< E * > > List_type
Definition: free_list.h:54
Free_list()
Definition: free_list.h:58
size_t length() const
Definition: free_list.h:62
void add_last(E *element)
Add an element to the end of the free list.
Definition: free_list.h:70
E * get_lru() const
Get the least recently used element in the list, i.e., the first element.
Definition: free_list.h:101
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:42
PSI_memory_key key_memory_DD_cache_infrastructure
Definition: psi_memory_key.cc:36