How to understand the macro __init?
王哲
wangzhe5004 at gmail.com
Tue Aug 14 07:46:53 EDT 2012
2012/8/14 Ezequiel Garcia <elezegarcia at gmail.com>
> Hey wanny,
>
> On Tue, Aug 14, 2012 at 1:04 AM, Mulyadi Santosa
> <mulyadi.santosa at gmail.com> wrote:
> > Hi.. :)
> >
> > On Tue, Aug 14, 2012 at 9:14 AM, 王哲 <wangzhe5004 at gmail.com> wrote:
> >> i use the __init for function print_k.
> >> in my opinion after the fisrt invoking the print_k in the hello_init.
> >> the memory of print_k will be freed,and the second invoking will
> >> not be executed.but the result of second invoking is executing .
> >>
> >> why?
> >
> > because you're still in module_init.... :)
> >
> >
>
> Yes, and the function is still in the stack!
>
> On the other hand.. think what would happen if things would work
> like you say.
>
> We would have a *very* strange behavior,
> and pretty counter-intuitive, don't you think so?
>
Thank you very much for reply.
as you say,and function is still in the stack,don't be freed
in the memory,what is __init had done? who can give a sample example
to explain the difference existing __init or not?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120814/4407cb10/attachment.html
More information about the Kernelnewbies
mailing list