Use malloc for smem