Skip to main content

R_alloc

Function R_alloc 

Source
unsafe fn R_alloc(nelem: usize, eltsize: c_int) -> *mut c_char
Expand description

Allocate memory on R’s memory stack.

This memory is automatically freed when the calling R function returns, or can be freed earlier with vmaxset().

§Parameters

  • nelem: Number of elements to allocate
  • eltsize: Size of each element in bytes

§Returns

Pointer to allocated memory (as char* for compatibility with S). Checked wrapper for R_alloc. Calls R_alloc_unchecked and routes through with_r_thread. Generated from source location line 3332, column 8. Generated from source file miniextendr-api/src/ffi.rs.