More testing before rethinking the way memory management is happening. I suspect it is possible to use mremap to preserve original code addresses.