entry: replace init_*_seg with memcpy/memset