From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff King Subject: [PATCH 03/17] alloc: include any-object allocations in alloc_report Date: Tue, 10 Jun 2014 17:38:47 -0400 Message-ID: <20140610213847.GC19147@sigill.intra.peff.net> References: <20140610213509.GA26979@sigill.intra.peff.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: Junio C Hamano , Christian Couder , Jakub Narebski , Eric Sunshine To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Jun 10 23:38:57 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WuTkr-0003ht-85 for gcvg-git-2@plane.gmane.org; Tue, 10 Jun 2014 23:38:53 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753256AbaFJVit (ORCPT ); Tue, 10 Jun 2014 17:38:49 -0400 Received: from cloud.peff.net ([50.56.180.127]:41360 "HELO peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753209AbaFJVis (ORCPT ); Tue, 10 Jun 2014 17:38:48 -0400 Received: (qmail 19392 invoked by uid 102); 10 Jun 2014 21:38:48 -0000 Received: from c-71-63-4-13.hsd1.va.comcast.net (HELO sigill.intra.peff.net) (71.63.4.13) (smtp-auth username relayok, mechanism cram-md5) by peff.net (qpsmtpd/0.84) with ESMTPA; Tue, 10 Jun 2014 16:38:48 -0500 Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Tue, 10 Jun 2014 17:38:47 -0400 Content-Disposition: inline In-Reply-To: <20140610213509.GA26979@sigill.intra.peff.net> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: When 2c1cbec (Use proper object allocators for unknown object nodes too, 2007-04-16), added a special "any_object" allocator, it never taught alloc_report to report on it. To do so we need to add an extra type argument to the REPORT macro, as that commit did for DEFINE_ALLOCATOR. Signed-off-by: Jeff King --- alloc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/alloc.c b/alloc.c index f3ee745..38ff7e7 100644 --- a/alloc.c +++ b/alloc.c @@ -57,13 +57,14 @@ static void report(const char *name, unsigned int count, size_t size) name, count, (uintmax_t) size); } -#define REPORT(name) \ - report(#name, name##_allocs, name##_allocs * sizeof(struct name) >> 10) +#define REPORT(name, type) \ + report(#name, name##_allocs, name##_allocs * sizeof(type) >> 10) void alloc_report(void) { - REPORT(blob); - REPORT(tree); - REPORT(commit); - REPORT(tag); + REPORT(blob, struct blob); + REPORT(tree, struct tree); + REPORT(commit, struct commit); + REPORT(tag, struct tag); + REPORT(object, union any_object); } -- 2.0.0.729.g520999f