From: C Howland <cc1964t@gmail.com>
To: newlib@sourceware.org
Subject: Re: [PATCH newlib] libc/include/malloc.h: Add prototype for GNU extension malloc_usable_size()
Date: Tue, 15 Mar 2022 11:38:20 -0400 [thread overview]
Message-ID: <CANk6obQ3F2Y2WcKEbphBRr1i9q6t9UNgrMUSxwjN0TW-NFhpPg@mail.gmail.com> (raw)
In-Reply-To: <BN2P110MB1544D6E89DF3E9BB09EC091D9A109@BN2P110MB1544.NAMP110.PROD.OUTLOOK.COM>
>
> ------------------------------
> *From:* Newlib <newlib-bounces+craig.howland=caci.com@sourceware.org> on
> behalf of Joel Sherrill <joel@rtems.org>
> *Sent:* Tuesday, March 15, 2022 11:16 AM
> *To:* newlib@sourceware.org <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
next prev parent reply other threads:[~2022-03-15 15:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 15:16 Joel Sherrill
[not found] ` <BN2P110MB1544D6E89DF3E9BB09EC091D9A109@BN2P110MB1544.NAMP110.PROD.OUTLOOK.COM>
2022-03-15 15:38 ` C Howland [this message]
2022-03-15 15:44 ` Joel Sherrill
2022-03-15 15:54 ` C Howland
2022-03-15 15:47 ` Mike Frysinger
2022-03-15 18:42 ` Sebastian Huber
2022-03-15 20:36 ` Mike Frysinger
2022-03-15 21:14 ` Joel Sherrill
2022-03-15 20:54 ` Joel Sherrill
2022-03-15 23:50 ` Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CANk6obQ3F2Y2WcKEbphBRr1i9q6t9UNgrMUSxwjN0TW-NFhpPg@mail.gmail.com \
--to=cc1964t@gmail.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).