Skip to content

Commit cceda82

Browse files
committed
docs: improve StringOffset docs
1 parent 4dcbf53 commit cceda82

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

datadog-profiling-ffi/cbindgen.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ renaming_overrides_prefixing = true
8585

8686
"GenerationalId_StringId" = "ddog_prof_StringId"
8787
"Result_GenerationalIdStringId" = "ddog_prof_StringId_Result"
88+
89+
# StringId is an alias of StringOffset, we need both to be `OpaqueStringId`
90+
# for the current interning API.
8891
"StringOffset" = "OpaqueStringId"
8992
"StringId" = "OpaqueStringId"
9093

datadog-profiling-protobuf/src/string.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ impl Value for &str {
1616
}
1717
}
1818

19+
/// Represents an offset into the Profile's string table. Note that it cannot
20+
/// exceed u32 because an entire protobuf message must not be larger than or
21+
/// equal to 2 GiB. By the time you encode the tag and length prefix for each
22+
/// string, there's no way to get this many unique-ish strings without first
23+
/// exceeding the protobuf 2 GiB limit.
1924
#[repr(C)]
2025
#[derive(Copy, Clone, Default, Debug, Eq, PartialEq, PartialOrd, Ord, Hash)]
2126
#[cfg_attr(test, derive(bolero::generator::TypeGenerator))]

0 commit comments

Comments
 (0)