Skip to main content

Module ownership

Module ownership 

Source
Expand description

Maintain ownership of R objects.

This provides the functions protect and unprotect. A single preserved vector holds ownership of all protected objects.

Objects are reference counted, so multiple calls are possible, unlike R_PreserveObject.

This module exports two functions, protect(sexp) and unprotect(sexp).

Re-exportsยง

use once_cell::sync::Lazy; ๐Ÿ”’
use std::collections::hash_map::Entry; ๐Ÿ”’
use std::collections::hash_map::HashMap; ๐Ÿ”’
use std::sync::Mutex; ๐Ÿ”’
use extendr_ffi::R_NilValue; ๐Ÿ”’
use extendr_ffi::R_PreserveObject; ๐Ÿ”’
use extendr_ffi::R_ReleaseObject; ๐Ÿ”’
use extendr_ffi::R_xlen_t; ๐Ÿ”’
use extendr_ffi::Rf_allocVector; ๐Ÿ”’
use extendr_ffi::Rf_protect; ๐Ÿ”’
use extendr_ffi::Rf_unprotect; ๐Ÿ”’
use extendr_ffi::LENGTH; ๐Ÿ”’
use extendr_ffi::SET_VECTOR_ELT; ๐Ÿ”’
use extendr_ffi::SEXP; ๐Ÿ”’
use extendr_ffi::SEXPTYPE; ๐Ÿ”’
use extendr_ffi::VECTOR_ELT; ๐Ÿ”’
use self::send_sexp::SendSEXP; ๐Ÿ”’

Modulesยง

send_sexp ๐Ÿ”’
Provide a wrapper around Rโ€™s pointer type SEXP that is Send.

Structsยง

Object ๐Ÿ”’
Ownership ๐Ÿ”’

Constantsยง

EXTRA_PRESERVATION_SIZE
INITIAL_PRESERVATION_SIZE

Staticsยง

OWNERSHIP ๐Ÿ”’

Functionsยง

protect ๐Ÿ”’ โš 
unprotect ๐Ÿ”’ โš