It's a function called "free" that makes a memory alloc.
But as a factor, you only get one pointer, how much dynamic allocation is there They didn't hand over the size, so how do you know how much dynamic allocation they're going to release?
c
https://stackoverflow.com/a/1957125/9437175
You can refer to the link above, and when you allocate memory, you can allocate a little more spare memory to store additional information about that memory, so you can see the size.
When memory is allocated, additional information is stored as part of a data structure maintained by the heap manager. This information includes, among other things, the block’s size, and is typically placed immediately adjacent to the allocated block.
© 2024 OneMinuteCode. All rights reserved.