News for hackers. Stuff that matters.
Re:Swapping two blocks of memory inside a larger block, in c... by ot on Tuesday January 06, 2026 @12:01PM (#46514936)
That's probably true for small primitive types, but if your objects are expensive to move (like a large struct) it might be beneficial to minimize swaps.
Re:Swapping two blocks of memory inside a larger block, in c... by praptak on Tuesday January 06, 2026 @02:20PM (#46517171)
Yeah, it might be interesting to run some profiling of both algorithms and see how they perform dependent on the size of the blocks being swapped (which doesn't even have to be equal to the size of the object in the array).