From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118735 invoked by alias); 6 Feb 2017 22:36:34 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 118711 invoked by uid 89); 6 Feb 2017 22:36:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.5 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,UNWANTED_LANGUAGE_BODY autolearn=no version=3.3.2 spammy=U*siddhesh, siddheshsourcewareorg, siddhesh@sourceware.org, GPG X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-out.m-online.net X-Auth-Info: MFbzr0r/BybBLgQbT3lrbjS95qkIEP/rKrs3T+D2FHj7ZYRcsN5S/shhB/u/Qsve From: Andreas Schwab To: Siddhesh Poyarekar Cc: libc-alpha@sourceware.org, fweimer@redhat.com, carlos@redhat.com Subject: Re: [PATCH 1/4] Add framework for tunables References: <1483070938-2308-1-git-send-email-siddhesh@sourceware.org> <1483070938-2308-2-git-send-email-siddhesh@sourceware.org> X-Yow: If this was a SWEDISH MOVIE, I'd take off your GO-GO BOOTS!! Date: Mon, 06 Feb 2017 22:36:00 -0000 In-Reply-To: <1483070938-2308-2-git-send-email-siddhesh@sourceware.org> (Siddhesh Poyarekar's message of "Fri, 30 Dec 2016 09:38:55 +0530") Message-ID: <87y3xjc5gd.fsf@linux-m68k.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-02/txt/msg00099.txt.bz2 On Dez 30 2016, Siddhesh Poyarekar wrote: > diff --git a/malloc/arena.c b/malloc/arena.c > index eed4247..234035f 100644 > --- a/malloc/arena.c > +++ b/malloc/arena.c > @@ -19,6 +19,11 @@ > > #include > > +#if HAVE_TUNABLES > +# define TUNABLE_NAMESPACE malloc > +#endif > +#include > + > /* Compile-time constants. */ > > #define HEAP_MIN_SIZE (32 * 1024) > @@ -204,6 +209,34 @@ __malloc_fork_unlock_child (void) > __libc_lock_init (list_lock); > } > > +#if HAVE_TUNABLES > +static inline int do_set_mallopt_check (int32_t value); > +void > +DL_TUNABLE_CALLBACK (set_mallopt_check) (void *valp) > +{ > + int32_t value = *(int32_t *) valp; This is wrong. The callback receives a pointer to tunable_val_t. > + do_set_mallopt_check (value); > + if (check_action != 0) > + __malloc_check_init (); > +} > + > +# define DL_TUNABLE_CALLBACK_FNDECL(__name, __type) \ > +static inline int do_ ## __name (__type value); \ > +void \ > +DL_TUNABLE_CALLBACK (__name) (void *valp) \ > +{ \ > + __type value = *(__type *) valp; \ Likewise. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."