Skip to content

Commit cd903df

Browse files
authored
docs(profiling-ffi): ProfilesDictionary_insert_str (#1486)
docs(profiling-ffi): ProfilesDictionary_insert_str This documents that the string is copied, more on the lifetime of the StringId2 that's returned, and more. Merge branch 'main' into levi/docs-intern Co-authored-by: levi.morrison <[email protected]>
1 parent db4a985 commit cd903df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libdd-profiling-ffi/src/profiles/profiles_dictionary.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ pub unsafe extern "C" fn ddog_prof_ProfilesDictionary_insert_mapping(
142142

143143
/// Inserts a UTF-8 string into the dictionary string table.
144144
///
145+
/// Copies the string into the internal buffer--strings are arena allocated
146+
/// and not individually allocated. On success, the [`StringId2`] written to
147+
/// the `string_id` out parameter is valid as long as this dictionary is alive.
148+
/// It should only be passed back to the dictionary that created it.
149+
///
145150
/// # Safety
146151
///
147152
/// - `string_id` must be non-null and valid for writes of `StringId`.

0 commit comments

Comments
 (0)