• 0 Posts
  • 3 Comments
Joined 2 years ago
cake
Cake day: August 24th, 2023

help-circle
  • Glibc’s qsort will default to either insertion sort mergesort or heapsort. Quicksort itself is used when it cannot allocate extra memory for mergesort or heapsort. Insertion sort is still used in the quicksort code, when there is a final 4 items that need to be sorted.

    Normally it is simply mergesort or heapsort. Why I know this? Because there was a recent CVE for quicksort and to reproduce the bug I had to force memory to be unable to be allocated with a max size item. It was interesting reading the source code.

    That is if you are not on a recent version of qsort which simply removed quicksort altogether for the mergesort + heapsort

    Older version still had quicksort and even some had insertion sort. Its interesting to look at all the different versions of qsort.



  • You should try to min-max your weekend but instead shift what your expectations are for the min-max. Planning ahead of the weekend is good to reduce anxiety over what you are doing at each minute of the weekend. You plan it out and stick to it. If something comes up that fucks the plan up, then simply it was just not meant to be. Do plan out moments where you are resting too, because if you are planning to do tasks, then you should plan when there is a clear time to rest. Usually tasks happen between times of rest. So plan those rest times accordingly, as those are the only moments when your body can repair and do what it needs to do to keep you healthy. Good luck