|
 |
> Warp wrote:
>> reason memory allocation speed is not something which has been optimized
>> to death in C(++) compilers, for whatever reasons
>
> I'm suspecting it's because C and C++ use pointers rather than
> references, and can't carry around enough metadata (generally speaking)
> to allow finding the pointers in a data structure, so they can't compact
> memory. That means that finding free memory is generally a search.
Well, you can't move objects around in memory to compact, that is true.
However, nothing stops a memory allocator from keeping lots of metadata
internally to find free memory quickly.
How do filesystems know what empty blocks are available to save a new
file? A linear search from the beginning of the disk?
Post a reply to this message
|
 |