3 ms·
I guess I'm confused at this chain of responses, then. As I'm doing what you are already suggesting. Re-reading your comment, about the "not really freeing an
by legohead 2y ago
I guess I'm confused at this chain of responses, then. As I'm doing what you are already suggesting.
Re-reading your comment, about the "not really freeing anything" -- I beg to differ, as when you do a real free(), it frees up memory for any program to use. As I already mentioned one of the benefits is once you have control of who can use that memory and aren't risking it not being available - disregarding some program that constantly grows in memory.
- thwarted 2y agowhen you do a real free(), it frees up memory for any program to use This is an extremely naive description of not only what the libc free() function does, but also of how memory management works in general.
- deleted 2y ago[deleted]
- legohead 2y agoThere are always details within details. The overall idea is easily understandable. You are being pedantic.
- thwarted 2y agoYour description reveals a complete lack of understanding, and pointing out someone's lack of understanding is not being pedantic. Your choice of wording—"real free()" and "any program"—misrepresents the inherent complexity of implementing an allocator and does a disservice to both those less experienced and to the discussion in this thread.
- shakna 2y agoYou're assuming a platform. There are not a great number of guarantees when it comes to free: The free subroutine deallocates a block of memory previously allocated by the malloc subsystem. Undefined results occur if the Pointer parameter is not an address that has previously been allocated by the malloc subsystem, or if the Pointer parameter has already been deallocated. If the Pointer parameter is NULL, no action occurs. All that is guaranteed, is a deallocation. Not how and when that memory will become available again. Your "more detailed" understanding will break, and will cause headaches, on platforms ypu're not used to.
- lloeki 2y ago> you have control of who can use that memory and aren't risking it not being available overcommit would like to have a word