Fix #9595

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
layout can be a const reference instead of a pointer.

The size parameter doesn't need to be marked const since it's passed by value.