No, it doesn’t. The free library function places the specified block of memory back onto the heap’s free list (at least conceptually…actual implementation details can vary). But the free function doesn’t have access to the memory containing the pointer, because …
Read moreWhy don’t they add a garbage collector to new versions of C and C++?
Let’s start by considering C++. As an opt-in option in C++, it is technically possible to add garbage collection to C++, as long as it is clearly specified how it integrates with the language and with the existing memory management …
Read more