Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKkke7qo-49=zQM8wz-ST_SDyfvFOixVWPQkVz0ChN_fEdr3tw@mail.gmail.com>
Date: Thu, 6 Nov 2025 15:10:03 -0800
From: Michael Winterberg <mike.winterberg@...il.com>
To: musl@...ts.openwall.com
Subject: Re: Re: realloci(): A realloc() variant that works in-place

> But, there's no need to rush the growth.  It should be fine to wait
> until you need to grow and then call realloci().
>

How many extant allocators actually "grow" beyond their result for
malloc_usable_size?

i.e. if Thiago replaced initial allocations with this,

void* malloc_size_feedback(size_t size, size_t* actual) {
    *actual = 0;
    void* p = malloc(size);
    if (p != 0) {
        *actual = malloc_usable_size(p);
        p = realloc(p, *actual);
    }
    return p;
}

would there still be a 10% hit rate on reuse?

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.