Return-Path: X-Original-To: apmail-mesos-dev-archive@www.apache.org Delivered-To: apmail-mesos-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 651C8175A2 for ; Wed, 11 Mar 2015 19:26:44 +0000 (UTC) Received: (qmail 80226 invoked by uid 500); 11 Mar 2015 19:26:39 -0000 Delivered-To: apmail-mesos-dev-archive@mesos.apache.org Received: (qmail 80146 invoked by uid 500); 11 Mar 2015 19:26:39 -0000 Mailing-List: contact dev-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mesos.apache.org Delivered-To: mailing list dev@mesos.apache.org Received: (qmail 80124 invoked by uid 99); 11 Mar 2015 19:26:38 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Mar 2015 19:26:38 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id EB70F1D3AF3; Wed, 11 Mar 2015 19:26:36 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============8185950249124371867==" MIME-Version: 1.0 Subject: Re: Review Request 31677: stout: Make the counting of netmask set bits more efficient. From: "Dominic Hamon" To: "Joris Van Remoortere" , "Benjamin Hindman" , "Jie Yu" , "Niklas Nielsen" , "Dominic Hamon" Cc: "Evelina Dumitrescu" , "mesos" , "Ben Mahler" Date: Wed, 11 Mar 2015 19:26:36 -0000 Message-ID: <20150311192636.14616.54813@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Dominic Hamon" X-ReviewGroup: mesos X-ReviewRequest-URL: https://reviews.apache.org/r/31677/ X-Sender: "Dominic Hamon" References: <20150311190013.14616.12491@reviews.apache.org> In-Reply-To: <20150311190013.14616.12491@reviews.apache.org> Reply-To: "Dominic Hamon" X-ReviewRequest-Repository: mesos --===============8185950249124371867== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On March 11, 2015, noon, Ben Mahler wrote: > > I'm curious, what prompted this change? a comment on the original version in a review that it wasn't the best way of counting bits. it seems like a generally useful thing to do. > On March 11, 2015, noon, Ben Mahler wrote: > > 3rdparty/libprocess/3rdparty/stout/include/stout/bits.hpp, line 25 > > > > > > Can we return a size_t to capture that this is a count and that negatives are not possible? > > > > Is `bits::count` not a sufficient name? as per the style guide, http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Integer_Types, "You should not use the unsigned integer types such as uint32_t, unless there is a valid reason such as representing a bit pattern rather than a number, or you need defined overflow modulo 2^N. In particular, do not use unsigned types to say a number will never be negative. Instead, use assertions for this." there may be a countUnsetBits in the future. Maybe countSet, but we could bikeshed all day :) - Dominic ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31677/#review76105 ----------------------------------------------------------- On March 10, 2015, 12:59 p.m., Evelina Dumitrescu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/31677/ > ----------------------------------------------------------- > > (Updated March 10, 2015, 12:59 p.m.) > > > Review request for mesos, Benjamin Hindman, Dominic Hamon, Jie Yu, Joris Van Remoortere, and Niklas Nielsen. > > > Repository: mesos > > > Description > ------- > > see summary > > > Diffs > ----- > > 3rdparty/libprocess/3rdparty/stout/Makefile.am a5224554f6851930aa97cadc5da3d010829d87dc > 3rdparty/libprocess/3rdparty/stout/include/Makefile.am ac2bbed6fe86623fb51cac3613d79d7b1372df9d > 3rdparty/libprocess/3rdparty/stout/include/stout/bits.hpp PRE-CREATION > 3rdparty/libprocess/3rdparty/stout/include/stout/ip.hpp e4e86deb8a42a1d91f4d4ac210eae26f8f57ee17 > 3rdparty/libprocess/3rdparty/stout/tests/bits_tests.cpp PRE-CREATION > > Diff: https://reviews.apache.org/r/31677/diff/ > > > Testing > ------- > > > Thanks, > > Evelina Dumitrescu > > --===============8185950249124371867==--