#[repr(C)]pub struct GLFWallocator {
pub allocate: Option<unsafe extern "C" fn(usize, *mut c_void) -> *mut c_void>,
pub reallocate: Option<unsafe extern "C" fn(*mut c_void, usize, *mut c_void) -> *mut c_void>,
pub deallocate: Option<unsafe extern "C" fn(*mut c_void, *mut c_void)>,
pub user: *mut c_void,
}Expand description
@brief Custom heap memory allocator.
This describes a custom heap memory allocator for GLFW. To set an allocator, pass it to @ref glfwInitAllocator before initializing the library.
@sa @ref init_allocator @sa @ref glfwInitAllocator
@since Added in version 3.4.
@ingroup init
Fields§
§allocate: Option<unsafe extern "C" fn(usize, *mut c_void) -> *mut c_void>The memory allocation function. See @ref GLFWallocatefun for details about allocation function.
reallocate: Option<unsafe extern "C" fn(*mut c_void, usize, *mut c_void) -> *mut c_void>The memory reallocation function. See @ref GLFWreallocatefun for details about reallocation function.
deallocate: Option<unsafe extern "C" fn(*mut c_void, *mut c_void)>The memory deallocation function. See @ref GLFWdeallocatefun for details about deallocation function.
user: *mut c_voidThe user pointer for this custom allocator. This value will be passed to the allocator functions.
Trait Implementations§
Source§impl Clone for GLFWallocator
impl Clone for GLFWallocator
Source§fn clone(&self) -> GLFWallocator
fn clone(&self) -> GLFWallocator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GLFWallocator
impl Debug for GLFWallocator
impl Copy for GLFWallocator
Auto Trait Implementations§
impl Freeze for GLFWallocator
impl RefUnwindSafe for GLFWallocator
impl !Send for GLFWallocator
impl !Sync for GLFWallocator
impl Unpin for GLFWallocator
impl UnwindSafe for GLFWallocator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more