I understand what stack and heap refer to. However, I struggle with understanding exactly swap can do.
For example, let's take Linux as the OS. I connect another hard disk to my machine, and I make additional swap space available (using space from the said disk) via
swapon commands. It is known that swap space can accommodate dynamically-allocated variables on the heap. So with a newly increased swap space,
malloc can allocate larger variables.
Question: Is swap space also used by the OS (any OS) to augment the stack portion of memory?