是否"sendmsg"缓冲区或味精的可用内存? [英] Does "sendmsg" free memory of the buffer or msg?

查看:44
本文介绍了是否"sendmsg"缓冲区或味精的可用内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sendmsg 的缓冲区或msg的可用内存是否可用?

Does sendmsg free memory of the buffer or msg?

请对此进行指导.

推荐答案

否, sendmsg()不会释放传入的内存.它不可能这样做,因为该内存甚至可能不是来自 malloc().您可以在调用 sendmsg()之后的任何时间)释放内存,因为系统已经制作了必要的副本.

No, sendmsg() does not free the passed-in memory. It cannot possibly do so, because that memory may not even have come from malloc(). You can free() the memory any time after calling sendmsg(), as the system will have already made the necessary copies.

这篇关于是否"sendmsg"缓冲区或味精的可用内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆