What is the difference between memset and kmalloc
Sorry for not being able to type Chinese.
I am a new hand in device driver development. The question may be stupid.
When I read the kernal code of a driver, in the __init function, I find to allocate memory to a per-device structure, some codes use kmalloc, but some codes use memset.
Can someone tell me the difference ?
Thx.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Have been solved.
I find that when codes use memset, the per-device struct variable is defined with the keyword static.
memset and kmalloc is so different,you mast see them with manual.