Actually, the whole "may_share_memory" part could be moved below that example.