let userdef_mem_apply mem = function
    | Mem -> F.wrap mem.store
    | Alloc -> F.wrap mem.alloc