On Fri, 2004-12-17 at 08:44 -0800, Alaios wrote: > Just another question... For the kernel code do u > prefer create variables declaring them e.x int myint; > char mychar; > ... > ... > etc > > Or do u use alloc instead? > > Can u plz tell me when it is better to use the first > way and when the second? If you need to have bigger chunks of memory use kmalloc (because it doesn't use the stack) and if you have some small variables or small structures the stack is fine. The reason is that the stack space is finite and we don't want to overflow it. btw, there's no point in doing "alloc" for something like int myint, you still need a pointer to the memory to keep track of it. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/