2 ms·
> Maybe every executable should do its own final assembly of memory image and fixups and stuff at execution? Sounds a lot like dynamic linking, though that doe
by MereInterest 5y ago
> Maybe every executable should do its own final assembly of memory image and fixups and stuff at execution?
Sounds a lot like dynamic linking, though that does have an extra step of indirection that can result in performance issues, either directly due to the pointer hopping or indirectly due to the inability to inline a dynamic function.
> Maybe we should be executing memory dumps that include zero'd pages already
For global variables, C/C++ include this already. That's why the initialization of `int x;` depends on whether it's a global variable or not. For newly allocated memory, whether on the stack or on the heap, initializing to a default value that is later overwritten would have a runtime cost. (e.g. If it is immediately passed as an out parameter to a function.) However, for global memory the initial value of `int x;` can be set in the program image with no runtime cost, so it is done automatically.