Home > Back-end > Design of a class of "garbage collection management", is at the end of the program is runn
Design of a class of "garbage collection management", is at the end of the program is runn
Time:09-17
Design of a class of "garbage collection management", is at the end of the program is running automatically release with new has not yet been allocated by the delete the interpretation of the basic dynamic memory, avoid the "memory leak",
CodePudding user response:
Overloading new and delete
CodePudding user response:
At the end of the program is running automatically release with new has not yet been allocated by the delete the interpretation of the dynamic memory Your operating system has the function of the ~
CodePudding user response:
Memory leak is general discussion program run "manger" hog the memory meaningless behavior, but also constantly cycle to occupy one toilet,
CodePudding user response:
https://blog.csdn.net/sinat_34967445/article/details/77365758 have a look at the principle of hooks on the underlying function, their implementation
CodePudding user response:
Their implementation class destructor, or use smart Pointers all pointer variable in the class