From: Florian Weimer <fweimer@redhat.com>
To: Siddhesh Poyarekar via Libc-alpha <libc-alpha@sourceware.org>
Cc: Siddhesh Poyarekar <siddhesh@sourceware.org>
Subject: Re: [PATCH] malloc: Clean up __malloc_initialized
Date: Fri, 18 Jun 2021 11:36:45 +0200 [thread overview]
Message-ID: <875yybsedu.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20210618090945.721332-1-siddhesh@sourceware.org> (Siddhesh Poyarekar via Libc-alpha's message of "Fri, 18 Jun 2021 14:39:45 +0530")
* Siddhesh Poyarekar via Libc-alpha:
> -/* In the GNU libc we rename the global variable
> - `__malloc_initialized' to `__libc_malloc_initialized'. */
> -#define __malloc_initialized __libc_malloc_initialized
> -/* Nonzero if the malloc is already initialized. */
> -extern int __malloc_initialized attribute_hidden;
You need to provide the attribute_hidden somewhere, otherwise you'll get
worse code on some targets.
> diff --git a/malloc/mcheck.c b/malloc/mcheck.c
> index 2a1fc645d4..93d7992a41 100644
> --- a/malloc/mcheck.c
> +++ b/malloc/mcheck.c
> @@ -21,6 +21,7 @@
> # define _MALLOC_INTERNAL
> # include <malloc.h>
> # include <mcheck.h>
> +# include <stdbool.h>
> # include <stdint.h>
> # include <stdio.h>
> # include <libintl.h>
> @@ -372,10 +373,12 @@ mabort (enum mcheck_status status)
> int
> mcheck (void (*func) (enum mcheck_status))
> {
> + extern bool __malloc_initialized;
> +
This suggests that __malloc_initialized should remain in the wrapper
header.
Thanks,
Florian
next prev parent reply other threads:[~2021-06-18 9:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-18 9:09 Siddhesh Poyarekar
2021-06-18 9:36 ` Florian Weimer [this message]
2021-06-18 9:53 ` [Patch v2] " Siddhesh Poyarekar
2021-06-22 4:47 ` Siddhesh Poyarekar
2021-06-22 12:46 ` Siddhesh Poyarekar
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=875yybsedu.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=siddhesh@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).