Sujet : Re: Which code style do you prefer the most?
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.cDate : 18. Mar 2025, 13:59:23
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vrbqn4$2hm7q$1@raubtier-asyl.eternal-september.org>
References : 1
User-Agent : Mozilla Thunderbird
Am 25.02.2025 um 16:15 schrieb Ar Rakin:
struct malloc_chunk
{
struct malloc_chunk *next; /* The next chunk. */
struct malloc_chunk *prev; /* The previous chunk. */
bool is_free; /* Whether this chunk is usable. */
size_t size; /* The size of this chunk. */
};
I prefer a memory allocator that only has a next-pointer per chunk.
mimalloc() satisfies this constraint for the mostly used small block
sizes as each block in a chain is power of two sized up to two pages.
And if it's not in a chain it is allocated.