From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH kvm-unit-tests 2/4] Introduce a C++ wrapper for the kvm APIs Date: Wed, 24 Nov 2010 12:01:39 -0600 Message-ID: <4CED5303.902@codemonkey.ws> References: <1290595933-13122-1-git-send-email-avi@redhat.com> <1290595933-13122-3-git-send-email-avi@redhat.com> <50DD1E97-0ECD-41E6-B6F8-1D78AA4A4876@suse.de> <4CED2416.1040102@codemonkey.ws> <20101124154006.GE15111@redhat.com> <4CED344B.3030000@codemonkey.ws> <4CED3FE6.50900@redhat.com> <4CED41A0.8060003@redhat.com> <4CED4276.9090103@redhat.com> <4CED445E.30105@redhat.com> <4CED4629.2060804@redhat.com> <4CED4738.2020406@redhat.com> <4CED488D.40806@redhat.com> <4CED4B0E.3030805@codemonkey.ws> <4CED4D36.3060708@redhat.com> <4CED4EC3.8090202@codemonkey.ws> <4CED4F2A.1040204@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Gleb Natapov , Alexander Graf , Marcelo Tosatti , kvm@vger.kernel.org To: Jes Sorensen Return-path: Received: from mail-qw0-f46.google.com ([209.85.216.46]:43555 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753461Ab0KXSCP (ORCPT ); Wed, 24 Nov 2010 13:02:15 -0500 Received: by qwb7 with SMTP id 7so3518qwb.19 for ; Wed, 24 Nov 2010 10:02:14 -0800 (PST) In-Reply-To: <4CED4F2A.1040204@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 11/24/2010 11:45 AM, Jes Sorensen wrote: > On 11/24/10 18:43, Anthony Liguori wrote: > >> On 11/24/2010 11:36 AM, Jes Sorensen wrote: >> >>> On 11/24/10 18:27, Anthony Liguori wrote: >>> >>> >>> >>>> The compiler won't generate an error. Only upon a call to >>>> file_release() will a null pointer dereference happens whereas in C++, >>>> because this paradigm is structured in the language, the compiler can >>>> help assist you. >>>> >>>> >>> Explicit code means you know what is going on, it means you can debug it >>> in gdb and match it. That is a *good* thing! >>> >>> >> So I take it you avoid switch statements, while, or for loops in your C >> code. >> > Those map easily to assembly code and gdb. > The mapping is definitely not simply especially after a couple rounds of loop unrolling and code motion. Regards, Anthony Liguori > Jes > > >