[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] Block layer complexity: what to do to keep
Re: [Qemu-block] [Qemu-devel] Block layer complexity: what to do to keep it under control?
Mon, 4 Dec 2017 10:16:36 +0000
On Fri, Dec 01, 2017 at 01:27:37PM -0600, Eric Blake wrote:
> On 12/01/2017 11:03 AM, Paolo Bonzini wrote:
> > Just my 2 cents on the language topic, as in general I agree completely
> > with Stefan.
> > Luckily, several benefits don't require a full rewrite or language switch:
> > - readability from RAII-style code. If this is important enough, we
> > could actually use GCC __attribute__((cleanup)) or, heaven forbid,
> > slowly introduce C++ in QEMU's code base.
> This one is cool, and supported by both gcc and clang (and we really don't
> have any example of anyone clamoring for a different compiler). For example,
> here's what I recently added to nbdkit to make it MUCH easier to properly
> remember to unlock a mutex on all exit paths from a scope:
Yes, please! __attribute__((cleanup)) is great and we should use it in
I haven't looked at compiler support though... :)
Description: PGP signature