From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12181 invoked from network); 30 Sep 2021 14:51:22 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 30 Sep 2021 14:51:22 -0000 Received: (qmail 27711 invoked by uid 550); 30 Sep 2021 14:51:20 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 27690 invoked from network); 30 Sep 2021 14:51:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=tUmlL4yD+pmyDBpys8RzDK+4BggXl3XcO89lvUbCjGA=; b=gXS4mQ6jXWUnwH5AknI8+C5Eh9Zi49XMrIzIkh3ubGao+ZpnUlSwuirTM1uMimTtue O4rMakb6Rie1iqOyT5CHiaFjdJ1DtR65cVXOfL/+3+TAECxskLpPwNY0zlJ78ncL9r1b UaeDNtya0sOv/y37nN7mRx5v3z4T/m3a1Y3jIvYGTPLR3EfZU9R8EW9wMtJOfxFpyA42 kgiORkjp5XeIBVMJuTx/O1KZkK16jaTL3tAgJRNxQqzvHWpbXP8nf45a1qYAl6qRXoBM YSyRxmg0bN7oGLfAZFq31ah1Zqs8xrxm/qdX4HWQGYi11lLxXrRxDfw165/S8OBlAJHX 8mGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=tUmlL4yD+pmyDBpys8RzDK+4BggXl3XcO89lvUbCjGA=; b=P6tp12ePDF4PhuZIGCNMhQbE+V+8Wo/u5X7qTps1kicDVokFOM+Wqy4hQX1tBiQDD1 22UFFr96n5Q4yMdJjoxmaSlxjYhZtMg5lnUd3iRZnLI+fP451zqSAOgIr7OLFUJHitvM ahIJgwybN/VdA0gQ7uGBQF8T1+p/bHYcOnXAkiuTh9PzLYzRtQ0T8kal1j+2vtm9NImh 9JIGKu3XiGO7Xht2p98655uG3WTy9U/ZtXdGYwr8fDpvoKu2kMG4MD8WDG1iJMeiYIwj iWzjSscy3rhI0Dnj9JzLW8hdXzcz7jVYC2Rv2V9WfX8lasNZf7eyuE8iSTzzcmi0+FWg RAZQ== X-Gm-Message-State: AOAM530IS1p2r6LYSKF2hBFc53V6v6OuCiVIFqKD3/Fr5a+2LsLr7uM1 1hZBaSC/RFzvYKMM0b2seZtCW3ZV1/NU1eaAFlELthtlfwo= X-Google-Smtp-Source: ABdhPJwzq2Y2LjkuD0QG8k9yoSlOlTvY0OOcxaQYVLMteXvNrRJuDG7/pR0JfhiBSMn9Vz7/3QuHPtfkC17rBSb9QJw= X-Received: by 2002:ab0:540e:: with SMTP id n14mr5790326uaa.73.1633013467529; Thu, 30 Sep 2021 07:51:07 -0700 (PDT) MIME-Version: 1.0 References: <36151c4f-872f-7f84-0402-8491234ea62a@arm.com> In-Reply-To: <36151c4f-872f-7f84-0402-8491234ea62a@arm.com> From: Fangrui Song Date: Thu, 30 Sep 2021 10:50:56 -0400 Message-ID: To: musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] Mallocng algorithm high-level overview On Thu, Sep 30, 2021 at 10:02 AM Jack Bond-Preston wrote: > > Hello, > > I'm currently working on porting mallocng to a new architecture and > could use some assistance understanding the algorithm. From searching > the web, I couldn't seem to find any high-level overview of musl's > mallocng allocator (save for the readme at github/richfelker > /mallocng-draft, which is a little briefer than what I am looking > for). If any such description exists, I would much appreciate > being pointed towards it. If not, would anyone be able to explain > some of the details of the allocator? Not answering the specific questions below, but I have some notes on https://gist.github.com/MaskRay/ac54b26d72452ac77ac578f2e625369f :) > Mostly I am interested in a more general high-level overview of how > the allocator works. There are also some specifics I am interested > in, if anyone is able to shine some light on these: > - The uses/purposes of the structures in meta.h. Particularly, meta > and group, and the relation between the two. > - The general overview of in-band and out-of-band metadata, and how/ > when they are used. > - The purpose/meaning of the UNIT define in meta.h. > - Any assumptions about alignment/pointer size the allocator may > make. > > Thanks very much for your time, I appreciate the request is a bit > broad, but any information is appreciated. Please don't hesitate to > reach out for more information. > > Cheers, > Jack