mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
After merge fixes
Added push_back(void *, MEM_ROOT *) to make some list-handling code easier that needs to be allocated in a different mem-root (Before one had to change thd->mem_root ; push_back(); restore mem_root.
This commit is contained in:
@ -113,6 +113,16 @@ public:
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
inline bool push_back(void *info, MEM_ROOT *mem_root)
|
||||
{
|
||||
if (((*last)=new (mem_root) list_node(info, &end_of_list)))
|
||||
{
|
||||
last= &(*last)->next;
|
||||
elements++;
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
inline bool push_front(void *info)
|
||||
{
|
||||
list_node *node=new list_node(info,first);
|
||||
@ -284,6 +294,8 @@ public:
|
||||
inline List() :base_list() {}
|
||||
inline List(const List<T> &tmp) :base_list(tmp) {}
|
||||
inline bool push_back(T *a) { return base_list::push_back(a); }
|
||||
inline bool push_back(T *a, MEM_ROOT *mem_root)
|
||||
{ return base_list::push_back(a, mem_root); }
|
||||
inline bool push_front(T *a) { return base_list::push_front(a); }
|
||||
inline T* head() {return (T*) base_list::head(); }
|
||||
inline T** head_ref() {return (T**) base_list::head_ref(); }
|
||||
|
Reference in New Issue
Block a user