Skip to content

Commit

Permalink
Minor: Document expected result of ddog_prof_Profile_add (#87)
Browse files Browse the repository at this point in the history
**What does this PR do?**:

Documents the expected result of the `ddog_prof_Profile_add` API.

**Motivation**:

While validating #80 on Ruby, I called `add` in a way that should've
triggered an error, but saw none.

On closer inspection, I had no error handling for `add` because it
wasn't clear to me that its result could indicate an error.

Thus, I decided to document that fact.

**Additional Notes**:

At some point we could change `add` to return an actual result,
allowing us to pass the error message back to the caller, but for now
I decided to just document it.

**How to test the change?**:

Documentation change only.
  • Loading branch information
ivoanjo authored Jan 16, 2023
1 parent f656058 commit 1924ddf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions profiling-ffi/src/profiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ pub unsafe extern "C" fn ddog_prof_Profile_drop(
/// The `profile` ptr must point to a valid Profile object created by this
/// module. All pointers inside the `sample` need to be valid for the duration
/// of this call.
//// Returns the internal id of the sample (> 0) if successful, and 0 on error.
///
/// # Safety
/// The `profile` ptr must point to a valid Profile object created by this
/// module.
/// This call is _NOT_ thread-safe.
pub extern "C" fn ddog_prof_Profile_add(
profile: &mut datadog_profiling::profile::Profile,
Expand Down

0 comments on commit 1924ddf

Please sign in to comment.