Software/Embedded system

Memory - stack and heap

neovaga 2021. 5. 26. 22:07

 

Stack: Fixed memory, local variable, and function

- Stack overflow()

Heap: Dynamic memory // Malloc(), calloc(), realloc(), free() 

malloc: No initialization

calloc: initialization

int *B = (int*)realloc(NULL, n*sizeof(int)); // equivalent to malloc

-------

Code | Global | Stack | Heap

 

 

 

 

 

반응형

'Software > Embedded system' 카테고리의 다른 글

exec() System call concept  (0) 2021.06.27
fork() system call concept  (0) 2021.06.27
Priority Inversion (feat. Embeded system)  (0) 2021.05.23
Threads Concept  (0) 2021.05.23
The Keyword (feat. static, volatile)  (0) 2021.05.20