Skip to content

Commit c642b77

Browse files
author
GueLaKais
committed
Added comments to Function
To be honest, I still don't understand exactly what's happening here. All I know is that it's at least somewhat understandable what's going on here.
1 parent bc5fc1e commit c642b77

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

rosidl_runtime_rs/src/sequence.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,16 @@ macro_rules! impl_sequence_alloc_for_primitive_type {
578578
$init_func(seq as *mut _, size)
579579
}
580580
}
581+
/// Finalizes a sequence, freeing any associated resources.
582+
///
583+
/// # Safety
584+
///
585+
/// This function is unsafe because it calls an unsafe function `$fini_func`.
586+
/// The caller must ensure that `$fini_func` is safe to call with the provided arguments.
587+
///
588+
/// # Arguments
589+
///
590+
/// * `seq` - A mutable reference to the sequence to be finalized.
581591
fn sequence_fini(seq: &mut Sequence<Self>) {
582592
// SAFETY: There are no special preconditions to the sequence_fini function.
583593
unsafe { $fini_func(seq as *mut _) }

0 commit comments

Comments
 (0)