Update summary.md

This commit is contained in:
Yuelin Xin 2024-06-18 10:04:15 +08:00 committed by GitHub
parent 3862432cfe
commit e641db7947
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,4 +14,4 @@
**Q**: Is the "heap" in data structures the same concept as the "heap" in memory management? **Q**: Is the "heap" in data structures the same concept as the "heap" in memory management?
The two are not the same concept, even though they are both referred to as "heap". The heap in computer system memory is part of dynamic memory allocation, where the program can use it to store data during execution. The program can request a certain amount of heap memory to store complex structures like objects and arrays. When these data are no longer needed, the program needs to release this memory to prevent memory leaks. Compared to stack memory, the management and usage of heap memory demands more caution, as improper use may lead to memory leaks and dangling pointers. The two are not the same concept, even though they are both referred to as "heap". The heap in computer system memory is part of dynamic memory allocation, where the program can use it to store data during execution. The program can request a certain amount of heap memory to store complex structures like objects and arrays. When the allocated data is no longer needed, the program needs to release this memory to prevent memory leaks. Compared to stack memory, the management and usage of heap memory demands more caution, as improper use may lead to memory leaks and dangling pointers.