[libc-commits] [libc] [llvm] [libc] Improve qsort (PR #120450)

Lukas Bergdoll via libc-commits libc-commits at lists.llvm.org
Fri Dec 20 01:59:49 PST 2024


================
@@ -15,9 +15,13 @@
 #define LIBC_QSORT_QUICK_SORT 1
 #define LIBC_QSORT_HEAP_SORT 2
 
+#ifdef LIBC_OPTIMIZE_FOR_SIZE
+#define LIBC_QSORT_IMPL LIBC_QSORT_HEAP_SORT
+#else
----------------
Voultapher wrote:

I need more information here, my idea was to keep the existing `LIBC_CONF_QSORT_IMPL` flag for compatibility reasons and add a new one that could be re-used across different areas of the library. It's not immediately clear to me how to do that with `config.json` and what the implications would be, and even then it would have to be used here in this way also, no? 

https://github.com/llvm/llvm-project/pull/120450


More information about the libc-commits mailing list