public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "naesten at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug manual/32181] New: malloc_info should be documented
Date: Mon, 16 Sep 2024 21:53:16 +0000	[thread overview]
Message-ID: <bug-32181-131@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=32181

            Bug ID: 32181
           Summary: malloc_info should be documented
           Product: glibc
           Version: 2.41
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: manual
          Assignee: unassigned at sourceware dot org
          Reporter: naesten at gmail dot com
                CC: mtk.manpages at gmail dot com
  Target Milestone: ---

It would be good if malloc_info was mentioned in the manual, because:

  1. I have wasted entirely too much time wondering if it was deliberately
omitted or simply forgotten. (My conclusion: if you wanted people to avoid
using it, you would just say so explicitly rather than removing it.)

  2. It would be nice to see some official guidance on format stability, when
to use/avoid it, etc.

  3. Bionic says:

```c
#ifndef STRUCT_MALLINFO_DECLARED
#define STRUCT_MALLINFO_DECLARED 1
struct mallinfo { __MALLINFO_BODY };
#endif

/**
 * [mallinfo(3)](http://man7.org/linux/man-pages/man3/mallinfo.3.html) returns
 * information about the current state of the heap. Note that mallinfo() is
 * inherently unreliable and consider using malloc_info() instead.
 */
struct mallinfo mallinfo(void);

/**
 * On Android the struct mallinfo and struct mallinfo2 are the same.
 */
struct mallinfo2 { __MALLINFO_BODY };

/**
 * [mallinfo2(3)](http://man7.org/linux/man-pages/man3/mallinfo2.3.html)
returns
 * information about the current state of the heap. Note that mallinfo2() is
 * inherently unreliable and consider using malloc_info() instead.
 */
struct mallinfo2 mallinfo2(void) __RENAME(mallinfo);
```

and I was hoping the glibc manual would offer another perspective ("inherently
unreliable" seems ... a tad strong).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

                 reply	other threads:[~2024-09-16 21:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bug-32181-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@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).