From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by sourceware.org (Postfix) with ESMTPS id 852843858D20 for ; Tue, 15 Mar 2022 15:38:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 852843858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-xf31.google.com with SMTP id jx8so14785956qvb.2 for ; Tue, 15 Mar 2022 08:38:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=xw9dnHYvBtWt+ibbJ1VsQtxuG4p7qYUGvixnNA2PTxA=; b=hwAixkj3yft9xF58syVkdDynvzcr7KEhblnQq469JHICHb6cOjIFuNpXT8bPF85YVb p/vBrg0PQyxkJRhi8B6WiMovP5Cyin36ZUtnEwD4Y9nWegf1sPPMB0MnpKIMaR8pQzuu K0i8GP2bNgCow4xa0rgQ/kvSlDys3L8uJl3hcCqBZJUmTNqfgwAqVgYu5ypHogd899ja hewcXLz01hyWyA1FdYxp8rzIzcE6xcE8r1Abu82L/F0ZbFjkIwYbHzQrp+mKDupY0D4c /KbWJhA53BVctVycnqF0TQoBKGUUALhaIbk0TISrMPSLjtna2GOu6+jdgoHgirP4Lwiq BSbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=xw9dnHYvBtWt+ibbJ1VsQtxuG4p7qYUGvixnNA2PTxA=; b=BpuVQJZdv8SblniT11dW8gZFAi4FOOXnfFZdKXL0/3/7VvrN4o5cdNXQIiYPngr8Vd P3lYd5J/HB0FJf9frx04k9Y/4cYcLQ0OIRdeP2d0/C6UISKh7tItTk/JsDUsvZDyUmJI 76C4AW+A5XS659jWY2x3xNEiEfx1Fq/tNEwqTs50+ykxr9lRn3soUyqsRnf+l6V/BqU9 IdhfixXQ2quEDp/2mrSviXdvDFUebJz/tigValmYeU57oaxG3gaBoFXXVcSoELWKKRJK lAh/xpqIF1qGXDP8Z1mI1F2pFhiBZ/zJibYX7MmvVMvYB662I6e9X6w5H5Y9uBXQhkNw jfLQ== X-Gm-Message-State: AOAM531Jyj1T2m48J4d3Wv5cvUuWDKpiwLM8/UXak9Hz68fhnVMRMjD4 Qi90LODIsmAaQb4tcYffq2BpZ/5mxOAaRMIGWAD0a8DxrlWF X-Google-Smtp-Source: ABdhPJy3yvqVJsS1GWHrSe5nSM6kRqOg+BFVbCQEFYic4Z1CX/O1vuZHyO3YZYKijCkAgetSrJcU3QmMh3SM8fKIvCw= X-Received: by 2002:a05:6214:2689:b0:435:be79:a17e with SMTP id gm9-20020a056214268900b00435be79a17emr21634059qvb.35.1647358710817; Tue, 15 Mar 2022 08:38:30 -0700 (PDT) MIME-Version: 1.0 References: <20220315151644.369-1-joel@rtems.org> In-Reply-To: From: C Howland Date: Tue, 15 Mar 2022 11:38:20 -0400 Message-ID: Subject: Re: [PATCH newlib] libc/include/malloc.h: Add prototype for GNU extension malloc_usable_size() To: newlib@sourceware.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2022 15:38:33 -0000 > > ------------------------------ > *From:* Newlib on > behalf of Joel Sherrill > *Sent:* Tuesday, March 15, 2022 11:16 AM > *To:* newlib@sourceware.org > *Subject:* [PATCH newlib] libc/include/malloc.h: Add prototype for GNU > extension malloc_usable_size() > > > This is not provided by the newlib malloc implementation but may > be available in external implementations. > --- > newlib/libc/include/malloc.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/newlib/libc/include/malloc.h b/newlib/libc/include/malloc.h > index a9dc5bca6..e73095e1e 100644 > --- a/newlib/libc/include/malloc.h > +++ b/newlib/libc/include/malloc.h > @@ -137,6 +137,10 @@ extern void __malloc_lock(struct _reent *); > > extern void __malloc_unlock(struct _reent *); > > +#if __GNU_VISIBLE > +extern size_t malloc_usable_size(void *); > +#endif > + > /* A compatibility routine for an earlier version of the allocator. */ > > extern void mstats (char *); > -- > 2.24.4 > > Sorry, but I fail to see why adding this makes sense. If there's an application which adds a function they should be editing the header file when they add it. (There's not even a stub being supplied here.) Additionally, the Linux man page for the function says "The main use of this function is for debugging and introspection." That is, it is not even a general application utility, but of very limited use. Either provide the function with the prototype or no prototype. Craig