BettyEasy 发表于 2011-04-29 01:53

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.

BettyEasy 发表于 2011-04-29 02:13

Have been solved.

I find that when codes use memset, the per-device struct variable is defined with the keyword static.

heyangya 发表于 2011-05-02 00:34

memset and kmalloc is so different,you mast see them with manual.
页: [1]
查看完整版本: What is the difference between memset and kmalloc