[FOLD] Make isMemoOkay a free function