3 ms·
What if the machine code for the function is larger after than before? I guess even worst case, writing 151MB to disk is fast if you have the data ready. Very
by rictic 6y ago
What if the machine code for the function is larger after than before?
I guess even worst case, writing 151MB to disk is fast if you have the data ready. Very fast with a modern SSD.
- AndyKelley 6y agoThis is a fascinating topic that I hope to follow up with a more technical blog post. The short summary is that there is room for functions to grow, and if they still exceed the padding, they get moved around to a new location in both virtual memory and in the file. Because of indirect function calls this means callsites remain the same; only the GOT entry has to get updated. The actual function body is moved with the copy_file_range syscall, where available.