MCPcopy Create free account
hub / github.com/ImageOptim/libimagequant / liq_attr_create_with_allocator

Function liq_attr_create_with_allocator

imagequant-sys/src/ffi.rs:427–435  ·  view source on GitHub ↗
(_unused: *mut c_void, free: unsafe extern "C" fn(*mut c_void))

Source from the content-addressed store, hash-verified

425#[inline(never)]
426#[deprecated(note = "custom allocators are no longer supported")]
427pub extern "C" fn liq_attr_create_with_allocator(_unused: *mut c_void, free: unsafe extern "C" fn(*mut c_void)) -> Option<Box<liq_attr>> {
428 let attr = Box::new(liq_attr {
429 magic_header: LIQ_ATTR_MAGIC,
430 inner: Attributes::new(),
431 c_api_free: free,
432 });
433 debug_assert_eq!(std::ptr::addr_of!(*attr), unsafe { attr_to_liq_attr_ptr(&attr.inner) } as *const liq_attr);
434 Some(attr)
435}
436
437#[no_mangle]
438#[inline(never)]

Callers 1

liq_attr_createFunction · 0.85

Calls 1

newFunction · 0.85

Tested by

no test coverage detected