Inline memory access function