I like the idea of renting premises. I didn’t hear that before. Customers can rent small or large rooms. The keys to the leased space are similar to pointers.
Free memory is similar to the client, which returns the key and abandons its place, so the space can be recycled.
Space can be rented for an hour or forever. If the client rents the space forever, but loses the key and does not use this space, it is good that the memory leak is due to the fact that the space is not used and does not return back to the community.
The important point is that if the client returns his key, but saves a copy, he sews the seeds of the problem. The space will be recycled to the new official owner, but the old owner can unofficially return and destroy the space after gaining access using his unauthorized key.
source share