I wrote a similar thing for C99 [1], but "safe" (bound-checked), having both stack and heap allocation, and many other array/vector functions [2], including integer-optimized sort (in-place MSD binary radix sort -wich is availabe in typical C++ sort implementations, but not in C, as default qsort() relies on sorting functions-). With some benchmarks, too [3]
[1] https://github.com/faragon/libsrt
[2] https://faragon.github.io/svector.h.html
[3] https://github.com/faragon/libsrt/blob/master/doc/benchmarks...