포인터 변수 = 스택

포인터 변수 값으로 저장된 메모리 = 힙

프로그램이 실행될 때 생기는 메모리 구성(Layout)

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8c010bfb-7599-4159-9a61-03c83407f7d2/Untitled.png

https://gabrieletolomei.wordpress.com/miscellanea/operating-systems/in-memory-layout/

프로그램은 코드로 이루어진 덩어리이며 이를 처리하기 위해서는 다양한 종류의 데이터가 필요하다.

프로세스는 4GB 메모리 영역을 할당받고, 쓰레드별로 스택을 할당한다. 보통 1MB.

https://docs.microsoft.com/en-us/windows/desktop/procthread/thread-stack-size

스택과 힙의 차이점