Function allocarray

Source
pub fn allocarray(count: usize, size: usize) -> *mut c_void
Expand description

Allocate an array of elements with secure memory

This function allocates an array of elements with secure memory protection. It is similar to malloc, but allocates an array of elements instead of a single block of memory.

§Safety

This function is unsafe because it returns a raw pointer. The caller is responsible for freeing the memory with free.

§Arguments

  • count - The number of elements to allocate
  • size - The size of each element

§Returns

  • *mut libc::c_void - A pointer to the allocated memory, or null if allocation failed