[Click] C++ vs the kernel

Eddie Kohler kohler at cs.ucla.edu
Tue Jul 24 16:36:30 EDT 2007


Adam M wrote:
> On Tue, 24 Jul 2007 13:05:50 -0700, "Eddie Kohler" <kohler at cs.ucla.edu>
> said:
>> Click code is compiled with -fno-exceptions.  So if you try to use 
>> exceptions I would hope the compiler would complain.
> 
> What do you do if a constructor fails? Do you have to resort to
> initializing objects post-construction?

You program so that the object is not left in an inconsistent state.

>> Obviously one can overload operator new() with arguments that provide 
>> info about interrupt context.
>>
>> I'm sure there are bugs re: allocation in Click.  However Click almost 
>> always runs in non-interrupt context; and should not allocate memory in 
>> interrupt context.
> 
> The phrase "almost always" disturbs me a little bit. When would the
> "almost" be violated?

The FromDevice element explicitly hooks in to interrupt context; this is 
part of its functionality.

> Is that something that the Element implementer has
> complete control of? (Again, I'm not much of a kernel developer, so my
> questions may be naive).

Yes, it is.

Eddie



More information about the click mailing list