What should happen here?
deadalnix
deadalnix at gmail.com
Thu Sep 30 11:05:40 UTC 2021
On Wednesday, 29 September 2021 at 22:17:25 UTC, Elronnd wrote:
> On Wednesday, 29 September 2021 at 07:23:26 UTC, John Colvin
> wrote:
>> If you search from most recently added to least recent then
>> it’ll be super cheap in most cases. Almost stack-like.
>
> Yes, but pathological in the worst case. Kinda like a freelist
> without compaction, except your worst case isn't bounded.
>
> The generational GC hypothesis is relevant. It says that the
> worst case will come up, though it will be the exception rather
> than the rule; however, I don't know if the sorts of objects
> that need to be explicitly protected have usual lifetimes, so
> the situation might be even worse.
You can always fall back to a set when things get large.
More information about the Digitalmars-d
mailing list