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=-4.7 required=5.0 tests=MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11610 invoked from network); 4 Oct 2021 14:24:47 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 4 Oct 2021 14:24:47 -0000 Received: (qmail 9740 invoked by uid 550); 4 Oct 2021 14:24:43 -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 9494 invoked from network); 4 Oct 2021 14:24:42 -0000 To: musl@lists.openwall.com References: <36151c4f-872f-7f84-0402-8491234ea62a@arm.com> <20210930162455.GF4428@brightrain.aerifal.cx> From: Jack Bond-Preston Message-ID: Date: Mon, 4 Oct 2021 15:24:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210930162455.GF4428@brightrain.aerifal.cx> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [musl] Mallocng algorithm high-level overview Thanks for the reply Rich, it has been a great help. I have a couple more specific questions, sorry: - Am I correct in saying IB represents the size (in bytes) of the in-band metadata between slots? - Is it assumed that sizeof(struct group) == sizeof(UNIT) throughout the code (the struct is defined such that this is true)? If the size of the in-band metadata were to increase (due to additional/larger metadata) such that UNIT < sizeof(struct group) (due to the size of the group struct needing to increase to accommodate the larger in-band metadata), I assume some code would have to be changed to instead use the size of the new group struct where appropriate (e.g. when allocating some new group). I noticed there are a lot of expressions containing x + UNIT/UNIT + x, are these generally to ensure allocations etc. include enough space for the contents of the group struct, or are there other reasons for these (e.g. some kind of 1-UNIT buffer between slots)? Cheers, Jack