So, how does the system know to release that memory?
If I did this:
MyClass class;
That memory is created on the stack and will be released when the function returns, right? Does the OS assign some kind of process ID when it allocates dynamic memory on the heap to know when that PID exits to release all of its memory from the heap?
If I did this:
MyClass class;
That memory is created on the stack and will be released when the function returns, right? Does the OS assign some kind of process ID when it allocates dynamic memory on the heap to know when that PID exits to release all of its memory from the heap?