Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Mar 2023 19:52:17 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        David Chisnall <theraven@freebsd.org>
Cc:        Mateusz Guzik <mjguzik@gmail.com>, freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: CFT: snmalloc as libc malloc
Message-ID:  <ZATW0bUEhHSlDxJL@kib.kiev.ua>
In-Reply-To: <D7199237-B252-4172-B2C3-C111DFA4FC57@FreeBSD.org>
References:  <2f3dcda0-5135-290a-2dff-683b2e9fe271@FreeBSD.org> <CAGudoHFYMLk6EDrSxLiWFNBoYyTKXfHLAUhZC%2BRF4eUE-rip8Q@mail.gmail.com> <E140A3A2-5C4A-4458-B365-AD693AB853E8@FreeBSD.org> <CAGudoHFeFm1K%2BJSBXaxt2SNTv-tGFgT0onyErOCmBdVjmHaxUg@mail.gmail.com> <2836EF0C-8B4B-441C-927B-3796457A3865@FreeBSD.org> <CAGudoHG3m1OixvuYGMGC_9fFBoOEXD-feUB2BUiTA66u0mdSfw@mail.gmail.com> <D7199237-B252-4172-B2C3-C111DFA4FC57@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Mar 05, 2023 at 05:27:16PM +0000, David Chisnall wrote:
> Hi,
> 
> Thanks for the comments.  
> 
> The FlagLock is used in two places:
> 
>  - Early init, before anything in libc can be guaranteed to exist.
Before libc is initialized, there cannot be any threads except the current.
Same for libthr.

Since libthr uses internal allocator for things usually needed by mallocs,
including internal mutexes and thread keys, the only duty of third-party
malloc is to properly implement on-fork callbacks to ensure liveness after
forks.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZATW0bUEhHSlDxJL>