This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloc: Perform full initialization before __malloc_check_init
- From: DJ Delorie <dj at redhat dot com>
- To: fweimer at redhat dot com (Florian Weimer)
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 20 Sep 2017 15:17:38 -0400
- Subject: Re: [PATCH] malloc: Perform full initialization before __malloc_check_init
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dj at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B6EACC0733E3
fweimer@redhat.com (Florian Weimer) writes:
> + /* Perform full initialization. */
> + malloc_consolidate (&main_arena);
I'd like this comment to have more of a "why" component, so that future
readers understand why we're "consolidating" in an initialization
function, but otherwise the patch looks good to me. Perhaps this?
> /* Call this once to initialize the arenas as a side-effect. */
Alternatively, call the two functions that malloc_consolidate() calls:
malloc_init_state(av);
check_malloc_state(av);
(is the second really needed though?)