4 ms·
A great and easy idea, as long as you never need to release anything. Otherwise you end up with holes in your memory and you need to do compaction, and reserve
by tinus_hn 4y ago
A great and easy idea, as long as you never need to release anything. Otherwise you end up with holes in your memory and you need to do compaction, and reserve the memory you need to be able to do that.
- kragen 4y agoor you can just have memory fragmentation compaction doesn't require a lot of memory but it's slow and intrusive; it has to know where all your buffer pointers are
- tinus_hn 4y agoObviously permanently wasting memory on fragmentation is not an option on a device that typically has 24kb memory. Especially not just so you can specify long filenames for the shell, when the filesystem doesn’t even support those filenames.
- kragen 4y agothe alternative they chose was to permanently waste memory on fixed-size struct fields, so i guess it was actually an option malloc on the pdp-11 never compacted of course the filesystem supported 14 characters for the basename, but evidently we're talking about code with a 14-character limit on the pathname, not the basename
- tinus_hn 4y agoYou don’t need compaction to reuse fixed size structures. I presume their priorities were with creating a working system, not one that answers to the ‘requirements’ of 50 years into the future.
- kragen 4y agoyou don't need compaction to reuse heap-allocated memory either wasted memory due to heap fragmentation is very similar to wasted memory due to slack space in fixed-size structure fields