The truth (at least on most modern processors) is that both stacks and heaps do the same thing, since they are both just pieces of RAM. Thus, dereferencing a pointer is almost the same.
, /, malloc free syscalls . malloc . , , (, push, pop). - ( ) .
, , ( , ) . , , , , swap .
, , , , . , . , , cpu.
, std::vector . , , - , , . , . , .
, . ( ). . . . (, , , ). . , .