Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Must -read articles for C++ memory mangement

Tags:

c++

After reading "C++ Memory Management: From Fear to Triumph" series, I think they are must-read articles for memory management. I'd like to know what else must-read articles I shouldn't miss.

Thanks!

like image 587
Southsouth Avatar asked Jan 24 '10 03:01

Southsouth


People also ask

Is there memory management in C?

The C programming language provides several functions for memory allocation and management. These functions can be found in the <stdlib. h> header file.

What is needed for computer memory management?

What are the 3 areas of memory management? Memory management operates at three levels: hardware, operating system and program/application. The management capabilities at each level work together to optimize memory availability and efficiency. Memory management at the hardware level.

How many memory management functions are there in C?

There are 4 library functions provided by C defined under <stdlib.h> header file to facilitate dynamic memory allocation in C programming. They are: malloc() calloc()

How can I get free C memory?

You have to free() the allocated memory in exact reverse order of how it was allocated using malloc() . Note that You should free the memory only after you are done with your usage of the allocated pointers.


2 Answers

Herb sutter's treatment on Memory Management in his books "Exceptional C++" and "More Exceptional C++".

like image 130
Jagannath Avatar answered Sep 28 '22 01:09

Jagannath


Read and learn well about RAII idiom, Resource Acquisition Is Initialization from articles like the two below:

  • Memory and Resource Management by Stephen C. Dewhurst
  • Resource Acquisition is Initialization - Modern C++ Style - A Conversation with Bjarne Stroustrup, Part II
like image 45
mloskot Avatar answered Sep 28 '22 01:09

mloskot