Trait physx::foundation::AllocatorCallback[][src]

pub unsafe trait AllocatorCallback: Sized {
    unsafe extern "C" fn allocate(
        size: u64,
        name: *const c_void,
        file: *const c_void,
        line: u32,
        user_data: *const c_void
    ) -> *mut c_void;
unsafe extern "C" fn deallocate(
        ptr: *const c_void,
        user_data: *const c_void
    ); unsafe fn into_px(self) -> *mut PxAllocatorCallback { ... } }

A trait for creating allocator callbacks for PhysX.

Reporting the name, file and line is not enabled by default. Use set_report_allocation_names to toggle this on or off.

Required methods

unsafe extern "C" fn allocate(
    size: u64,
    name: *const c_void,
    file: *const c_void,
    line: u32,
    user_data: *const c_void
) -> *mut c_void
[src]

Safety

allocations must be align 16. This should not panic, since it is called in an FFI context and unwinding across the FFI barrier is UB.

unsafe extern "C" fn deallocate(ptr: *const c_void, user_data: *const c_void)[src]

Safety

must not panic.

Loading content...

Provided methods

unsafe fn into_px(self) -> *mut PxAllocatorCallback[src]

Safety

do not override this method.

Loading content...

Implementors

impl AllocatorCallback for DefaultAllocator[src]

impl AllocatorCallback for GlobalAllocCallback[src]

impl AllocatorCallback for TrackingAllocator[src]

Loading content...