|
|
|
|
|
by secondcoming
1117 days ago
|
|
> Now, who owns inner_struct? return_struct does since it is the only thing that knows the address. > Who is responsible for freeing it? return_struct is, unless you hand that responsibility over to something else. > Do I free it when I assign to it? Yes, unless you want leaks. > I think if we could visualise memory as cars on a road, we would see obvious traffic jams. That visualisation is helpful for threads, where the program is the road/map and the cars are the threads. I don't see how it's useful for memory. |
|