lkml.org 
[lkml]   [2006]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Compiling C++ modules
    On 4/27/06, Willy Tarreau <willy@w.ods.org> wrote:
    > On Thu, Apr 27, 2006 at 06:10:07PM +0300, Denis Vlasenko wrote:
    > > On Tuesday 25 April 2006 20:53, Avi Kivity wrote:
    > > > Very often one needs to acquire a resource, do something with it, and
    > > > then free the resource. Here, "resource" can mean a file descriptor, a
    > > > reference into a reference counted object, or, in our case, a spinlock.
    > > > And we want "free" to mean "free no matter what", e.g. on a normal path
    > > > or an exception path.
    > >
    > > ...
    > >
    > > > Additionally, C++ guarantees that if an exception is thrown after
    > > > spin_lock() is called, then the spin_unlock() will also be called.
    > > > That's an interesting mechanism by itself.
    > >
    > > Life gets even more interesting when you hit another exception
    > > inside destructor(s) being executed due to first one.
    > > Say, spin_unlock() discovers that lock is already unlocked
    > > and does "throw BUG_double_unlock".
    > >
    > > Even if you
    > > (a) remember what standard says about it
    > > (b) implemented nested exception handling correctly,
    > > then you are still left with
    > > (c) let's pray gcc has no bugs in stack unwinding
    > > and nested exceptions and nested destructor calls.
    > >
    > > Mozilla crashes over such things. For Mozilla, crash is not
    > > *that* catastrophic. For OS kernel, it is.
    >
    > Mozilla is written in C++ ? I start to better understand where the
    > 160 MB bloat comes from...

    Evolution is written in C.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-04-27 23:11    [W:0.023 / U:1.072 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site