This page tells that whenever there is not enough memory, stable_sort
reduces to an in-place algorithm with running time O(n(log n)(log n)):
Complexity
If enough extra memory is available, linearithmic in the distance between first and last: Performs up to N*log2(N) element comparisons (where N is this distance), and up to that many element moves. Otherwise, polyloglinear in that distance: Performs up to N*log22(N) element comparisons, and up to that many element swaps.
I want to profile it against another in-place algorithm with the same running time, so my question reduces to: how can I simulate a "lack of memory" so that the slower algorithm is performed in stable_sort
?