Like sort, but the comparison function takes an extra user data argument.
comparison function
a ByteArray
data to pass to compare_func
compare_func