Skip to main content

mx_get

Function mx_get 

Source
pub unsafe fn mx_get(sexp: SEXP) -> *mut mx_erased
Expand description

Extract an erased object pointer from an R external pointer.

Retrieves the *mut mx_erased stored in an R EXTPTRSXP.

§Arguments

  • sexp - R external pointer created by mx_wrap

§Returns

Pointer to the erased object, or null if:

  • sexp is not an external pointer
  • The external pointer has been invalidated

§Safety

  • sexp must be a valid SEXP
  • Must be called on R’s main thread
  • The returned pointer is only valid while R protects the SEXP