oqs_sys::common

Function OQS_MEM_aligned_alloc

source
pub unsafe extern "C" fn OQS_MEM_aligned_alloc(
    alignment: usize,
    size: usize,
) -> *mut c_void
Expand description

Internal implementation of C11 aligned_alloc to work around compiler quirks.

Allocates size bytes of uninitialized memory with a base pointer that is a multiple of alignment. Alignment must be a power of two and a multiple of sizeof(void *). Size must be a multiple of alignment. @note The allocated memory should be freed with OQS_MEM_aligned_free when it is no longer needed.