unsafe fn get_and_increment<T>(ptr: &mut *mut T) -> *mut T