This way avoids two syscalls, since I need the region to be writable both here and in `translate_context_threaded_code`, which is the only caller of this function.