map_alloc takes mask