Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bo Persson Newsgroups: comp.lang.c++ Subject: Re: Examples of current platforms/architectures where sizeof(void*) > sizeof(int*) ? Date: Wed, 1 Sep 2021 10:44:59 +0200 Lines: 19 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net OjD2Y6K4UlyXbCNZwDP55AWYoCV1HO0+IkfKiKm0pKUDM+g2m+ Cancel-Lock: sha1:ynrkarGLc42/eChRT/BbbNPOmUI= User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: Content-Language: sv Xref: csiph.com comp.lang.c++:80953 On 2021-09-01 at 10:13, Bonita Montero wrote: > Am 01.09.2021 um 09:57 schrieb Bo Persson: > >> Even on current byte addressed machines, malloc(1) gets us 8- or >> 16-bytes aligned allocations, partly to reduce memory fragmentation. > > No, just to limit the number of size-pools. And why do they have memory pools? :-) Note that I said "partly". Another reason is that some pool allocators use the space of the freed memory block to administer the pool. Then there is a 1-2 pointer minimum size for a block. > With modern allocators like jemallic, mimalloc or tcmalloc, fragmen- > tation isn't an issue for the small size pools and on 64 bit machines > isn't an issue for medium size pools (large blocks are usually directly > allocated via mmap() e.g.).