add examples for unmanaged/managed memory