3 ms·
...
by kasabali 6y ago
...
- thethirdone 6y agoNot caring amount memory leaks is not the same as not caring about memory consumption. The next line shows exactly why the choice is made. > It is because most objects that are allocated during an execution of mold are needed until the very end of the program. Using free would not affect that memory consumption much because most consumption would be freed at the end of the program.
- kasabali 6y ago...
- user-the-name 6y agoBut, again, that line does not, in any way, say that this project does nor care about memory consumption.
- zamalek 6y agoRaymond Chen has an amusing story about this[1]: > Since the missile will explode when it hits its target or at the end of its flight, the ultimate in garbage collection is performed without programmer intervention. [1]: https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98125 https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98...
- tjalfi 6y agoI also submitted it here in 2017[0]. [0] https://news.ycombinator.com/item?id=14233542 https://news.ycombinator.com/item?id=14233542
- hyperman1 6y agoThere might be a 'best of both worlds' idea in there: If mold mmaps the input files instead of reading them, the linker would not trash all cached files, and be faster itself as it reuses already cached files. Now the author seems a smart fellow, so maybe he did just that already, I didn't check the source.
- rui314 6y agomold uses only mmap for file IO. Not only input files but also an output file are mapped to memory using mmap(2).
- baruch 6y agoWouldn't this mean that you need to memcpy around? Maybe async-io (io_uring?) help here by doing zero-copy writes directly from the source. I don't know how much you need to mangle code (GOT/PLT, offsets) and how much it is a straight copy of object to object.