From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: DJ Delorie <dj@redhat.com>
Cc: sam@gentoo.org, libc-alpha@sourceware.org
Subject: Re: [RFC] Supporting malloc_usable_size
Date: Fri, 2 Dec 2022 14:49:37 -0500 [thread overview]
Message-ID: <aee675a9-9f4d-dc9d-eb19-9b5326ac3d60@gotplt.org> (raw)
In-Reply-To: <xnwn7962go.fsf@greed.delorie.com>
On 2022-12-02 14:16, DJ Delorie wrote:
> The value returned by malloc_usable_size() may be greater than the
> requested size of the allocation because of various internal
> implementation details, none of which the programmer should rely on.
> This function is intended to only be used for diagnostics and
> statistics; writing to the excess memory without first calling
> realloc() to resize the allocation is not supported. The returned
> value is only valid at the time of the call; any other call to a
> malloc family API may invalidate it.
That sounds reasonable. I wonder if the last statement could be taken
as a guarantee of validity up to a certain point (i.e. another call to a
malloc family API); should that be simply "The returned value is only
valid at the time of the call."?
Thanks,
Sid
next prev parent reply other threads:[~2022-12-02 19:49 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-24 21:32 Siddhesh Poyarekar
2022-12-02 4:42 ` DJ Delorie
2022-12-02 5:00 ` Sam James
2022-12-02 5:28 ` DJ Delorie
2022-12-02 12:36 ` Siddhesh Poyarekar
2022-12-02 19:16 ` DJ Delorie
2022-12-02 19:49 ` Siddhesh Poyarekar [this message]
2022-12-02 19:57 ` DJ Delorie
2022-12-02 12:03 ` Andreas Schwab
2022-12-02 12:22 ` Siddhesh Poyarekar
2022-12-02 12:34 ` Andreas Schwab
2022-12-02 12:39 ` Florian Weimer
2022-12-05 18:46 ` Zack Weinberg
2022-12-05 19:04 ` Siddhesh Poyarekar
2022-12-05 20:35 ` Florian Weimer
2022-12-06 19:25 ` Siddhesh Poyarekar
2022-12-07 10:01 ` Florian Weimer
2022-12-07 16:34 ` Siddhesh Poyarekar
2022-12-07 16:54 ` Adhemerval Zanella Netto
2022-12-07 16:57 ` Sam James
2022-12-07 17:39 ` Florian Weimer
2022-12-09 15:42 ` Siddhesh Poyarekar
2022-12-07 18:45 ` DJ Delorie
2022-12-02 12:54 ` Florian Weimer
2022-12-02 13:54 Wilco Dijkstra
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=aee675a9-9f4d-dc9d-eb19-9b5326ac3d60@gotplt.org \
--to=siddhesh@gotplt.org \
--cc=dj@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=sam@gentoo.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).