File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
datadog-profiling-ffi/src/profiles Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -419,7 +419,11 @@ pub unsafe extern "C" fn ddog_prof_Profile_new(
419
419
profile_new ( sample_types, period, None )
420
420
}
421
421
422
- /// Same as `ddog_profile_new` but also configures a `string_storage` for the profile.
422
+ /// Same as [ddog_prof_Profile_new] but also configures a `string_storage` for
423
+ /// the profile.
424
+ ///
425
+ /// # Safety
426
+ /// Has all same safety conditions as [ddog_prof_Profile_new].
423
427
#[ no_mangle]
424
428
#[ must_use]
425
429
/// TODO: @ivoanjo Should this take a `*mut ManagedStringStorage` like Profile APIs do?
@@ -809,6 +813,14 @@ pub unsafe extern "C" fn ddog_prof_Profile_serialize(
809
813
. into ( )
810
814
}
811
815
816
+ /// Borrows FFI Vec as an FFI Slice.
817
+ ///
818
+ /// # Safety
819
+ /// The input needs to be a valid reference to an FFI Vec, and the slice needs
820
+ /// to be used in a way consistent with the lifetime and safety rules. Some
821
+ /// things to avoid:
822
+ /// - Do not modify the Vec at all while the Slice is alive.
823
+ /// - Do not drop the Vec while the Slice is alive.
812
824
#[ must_use]
813
825
#[ no_mangle]
814
826
pub unsafe extern "C" fn ddog_Vec_U8_as_slice ( vec : & ddcommon_ffi:: Vec < u8 > ) -> Slice < u8 > {
Original file line number Diff line number Diff line change @@ -407,14 +407,9 @@ pub unsafe extern "C" fn ddog_prof_Profile_get_generation(
407
407
}
408
408
409
409
/// This functions returns whether the given generations are equal.
410
- ///
411
- /// # Safety: No safety requirements
412
410
#[ must_use]
413
411
#[ no_mangle]
414
- pub unsafe extern "C" fn ddog_prof_Profile_generations_are_equal (
415
- a : Generation ,
416
- b : Generation ,
417
- ) -> bool {
412
+ pub extern "C" fn ddog_prof_Profile_generations_are_equal ( a : Generation , b : Generation ) -> bool {
418
413
a == b
419
414
}
420
415
You can’t perform that action at this time.
0 commit comments