How does free know how much to free?

后端 未结 11 2336
情话喂你
情话喂你 2020-11-22 03:28

In C programming, you can pass any kind of pointer you like as an argument to free, how does it know the size of the allocated memory to free? Whenever I pass a pointer to s

11条回答
  •  一个人的身影
    2020-11-22 04:11

    malloc() and free() are system/compiler dependent so it's hard to give a specific answer.

    More information on this other question.

提交回复
热议问题