Why deallocating heap memory is much slower than allocating it?
问题 This is an empirical assumption (that allocating is faster then de-allocating). This is also one of the reason, i guess, why heap based storages (like STL containers or else) choose to not return currently unused memory to the system (that is why shrink-to-fit idiom was born). And we shouldn't confuse, of course, ' heap ' memory with the ' heap '-like data structures. So why de-allocation is slower ? Is it Windows -specific (i see it on Win 8.1 ) or OS independent? Is there some C++ specific