|
|
>>> Oh, you have discovered a method to completely avoid memory
>>> fragmentation? :-o Is it efficient?
>
>> Yes, and yes.
>
> That would mean that the memory allocation engine knows ahead of time
> the order in which objects will be "forgotten" (ie. nothing points to them
> anymore so they can be freed) so that it can group them in contiguous
> memory. Of course this is impossible (not even by analyzing the program
> because the order in which objects are "forgotten" may depend on things
> like user input).
>
> The only other alternative is that it performs memory defragmentation
> before freeing the objects. But that doesn't sound any faster than
> freeing the objects directly.
Go through memory, find all the dead objects, and *then* defrag the
whole lot in a single pass. Done.
Post a reply to this message
|
|