分类: 嵌入式
2011-01-10 10:32:06
先看看kernel里的定义:
/** * kzalloc - allocate memory. The memory is set to zero. * @size: how many bytes of memory are required. * @flags: the type of memory to allocate (see kmalloc). */ static inline void *kzalloc(size_t size, gfp_t flags) { return kmalloc(size, flags | __GFP_ZERO); }
kzalloc实现了kmalloc以及memset的功能,一个函数起到了两个函数的作用