Get the App
SLTechnology News&Howtos  ›  Servers  › 

Stack and stack

Shulou Source: shulou.com Published: 2022-06-03 08:42:45 12月06日 Update

Difference:

Heap: allocated and freed by programmers

Stack: automatically allocated and released by the compiler, storing the return value of the function, local variables

Usage skills:

The stack of tasks in embedded systems is very small, try not to allocate variables that occupy large memory on the stack, and do not use recursive methods to design programs to prevent stack overflow.

The three most important segments of an executable program:

.text: code to store program

.data: initialized data

.bss: No variables initialized properly

Tags: Program variable assignment important three code task usage skill memory function local embedded skill data way programmer system compiler recursion compilation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft NVidia Shulou Information MySQL Redmi