diff --git a/rustler/src/resource.rs b/rustler/src/resource.rs index ff3106ba..58ffd40c 100644 --- a/rustler/src/resource.rs +++ b/rustler/src/resource.rs @@ -109,7 +109,7 @@ fn get_alloc_size_struct() -> usize { /// Given a pointer `ptr` to an allocation of `get_alloc_size_struct::()` bytes, return the /// first aligned pointer within the allocation where a `T` may be stored. /// Unsafe: `ptr` must point to a large enough allocation and not be null. -unsafe fn align_alloced_mem_for_struct(ptr: *const c_void) -> *const c_void { +pub unsafe fn align_alloced_mem_for_struct(ptr: *const c_void) -> *const c_void { let offset = mem::align_of::() - ((ptr as usize) % mem::align_of::()); ptr.add(offset) }