[Patch v2] malloc: Clean up __malloc_initialized
Siddhesh Poyarekar
siddhesh@gotplt.org
Tue Jun 22 12:46:20 GMT 2021
On 6/18/21 3:23 PM, Siddhesh Poyarekar via Libc-alpha wrote:
> It can be assumed that ptmalloc_init is always called in a
> single-threaded context because pthread_create calls malloc before
> spawning a thread. As a result, a boolean value for
> __malloc_initialized is sufficient to ensure that the function body is
> executed only once.
>
> Further, __malloc_initialized is mentioned in Versions when it is
> actually an internal symbol. Drop that reference and the macro
> definition to __libc_malloc_initialized since it does not have an
> external use.
Ahh no, this breaks mcheck initialization, which depends on the
intermediate value to ensure it is initialized only once. I'll figure
out a way to work this into the hooks removal patchset since it
simplifies the mcheck functionality a bit.
Siddhesh
More information about the Libc-alpha
mailing list