summaryrefslogtreecommitdiff
path: root/sql/sql_list.h
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-11-09 03:58:44 +0200
committermonty@mysql.com <>2004-11-09 03:58:44 +0200
commit2bba55b57fba78b018fe3ed64bafb7ea4b0c9d5c (patch)
tree7557a3bb8550c387349bc97e96a2a76d71c3ee52 /sql/sql_list.h
parent10871866578b68a656057797db9ac8f08418238a (diff)
downloadmariadb-git-2bba55b57fba78b018fe3ed64bafb7ea4b0c9d5c.tar.gz
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.
Diffstat (limited to 'sql/sql_list.h')
-rw-r--r--sql/sql_list.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/sql_list.h b/sql/sql_list.h
index d8d3719d39d..141742c3d4a 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -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(); }