This patch adds the function g_list_merge_sorted to glib. It merges two already-sorted lists into one big sorted list in linear time.