From patchwork Tue May 14 00:23:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 32666 Received: (qmail 61361 invoked by alias); 14 May 2019 00:23:18 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 61345 invoked by uid 89); 14 May 2019 00:23:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HTo:U*fw X-HELO: mx1.redhat.com From: DJ Delorie To: Florian Weimer Cc: libc-alpha@sourceware.org Subject: Re: [patch] Add various constants to malloc_info output. In-Reply-To: <87mujtikay.fsf@mid.deneb.enyo.de> (message from Florian Weimer on Sat, 11 May 2019 08:20:37 +0200) Date: Mon, 13 May 2019 20:23:11 -0400 Message-ID: MIME-Version: 1.0 Florian Weimer writes: > I think this needs to be conditional on USE_TCACHE. Conditionaled wrt the constant being printed. I think this is a more sensible rule for this type of "all constants" logic - it makes the list and its conditionals independent of when they get defined. * malloc/malloc.c (__malloc_info): Add various constants to the output. diff --git a/malloc/malloc.c b/malloc/malloc.c index b8baaa2706..3a83523fb6 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -5387,6 +5387,18 @@ __malloc_info (int options, FILE *fp) fputs ("\n", fp); + fprintf (fp, "\n", (long) MALLOC_ALIGNMENT); + fprintf (fp, "\n", (long) MIN_CHUNK_SIZE); + fprintf (fp, "\n", (long) MAX_FAST_SIZE); +#ifdef MAX_TCACHE_SIZE + fprintf (fp, "\n", (long) MAX_TCACHE_SIZE); +#endif + fprintf (fp, "\n", (long) MIN_LARGE_SIZE); + fprintf (fp, "\n", (long) DEFAULT_MMAP_THRESHOLD); + fprintf (fp, "\n", (long) DEFAULT_MMAP_THRESHOLD_MAX); + fprintf (fp, "\n", (long) HEAP_MIN_SIZE); + fprintf (fp, "\n", (long) HEAP_MAX_SIZE); + /* Iterate over all arenas currently in use. */ mstate ar_ptr = &main_arena; do