By: Adrian (a.delete@this.acm.org), July 1, 2022 1:04 am
Room: Moderated Discussions
Sorry, I have not reread the text before sending and a nonsensical sentence remained:
Original:
>
> After allocating 1 million objects of sizes 33-64 and randomly freeing all
> but 1 thousand, the 64-B stack will have at least 1 thousand free blocks ready
> to satisfy any allocation request for sizes in the 33-64 bytes range.
>
Intended:
After allocating 1 million objects of sizes 33-64 and randomly freeing all but 1 thousand, the 64-B stack will have 1 million less 1 thousand free blocks ready to satisfy any allocation request for sizes in the 33-64 bytes range.
My point was that it does not matter how you allocate and free, any new malloc request can be satisfied as easy after one year of running as at the startup time, inside the process.
Regarding what happens if the process never allocates objects of some size again, after freeing them, that was discussed lower in the previous message.