Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add breadcrumb ringbuffer to avoid O(n) memmove #1060

Merged
merged 27 commits into from
Nov 4, 2024
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1f6dd14
feat: initial ringbuffer implementation
JoshuaMoelans Oct 24, 2024
369da4e
chore: cleanup code
JoshuaMoelans Oct 24, 2024
55fdedc
chore: added todo
JoshuaMoelans Oct 24, 2024
8fd41b4
removed unnecessary buffer end value
JoshuaMoelans Oct 28, 2024
68d2352
changed buffer start_idx storage to [0]
JoshuaMoelans Oct 28, 2024
49ae90b
fixed issues in new storing method
JoshuaMoelans Oct 28, 2024
efbeaa1
updated test to new ringbuffer append logic
JoshuaMoelans Oct 28, 2024
8d0a142
refactor: renamed to sentry__value_append_ringbuffer
JoshuaMoelans Oct 28, 2024
a16bc80
test: removed old bounded append test
JoshuaMoelans Oct 28, 2024
03d320c
chore: update CHANGELOG.md
JoshuaMoelans Oct 28, 2024
0386111
Merge branch 'master' into feat/breadcrumb_ringbuffer_joshua
JoshuaMoelans Oct 28, 2024
a35a735
chore: update CHANGELOG.md
JoshuaMoelans Oct 28, 2024
29cf79d
chore: linting
JoshuaMoelans Oct 28, 2024
872b094
increase refcount of ringbuffer-to-list items
JoshuaMoelans Oct 29, 2024
2e174e0
apply suggestion from code review
JoshuaMoelans Oct 29, 2024
bf3f5a6
added ringbuffer test
JoshuaMoelans Oct 29, 2024
3776158
fixed ringbuffer to list conversion
JoshuaMoelans Oct 29, 2024
6081534
direct access to ringbuffer items
JoshuaMoelans Oct 29, 2024
38d1ef9
updated test with proper refcount check
JoshuaMoelans Oct 29, 2024
9c51975
removed unnecessary decref from test
JoshuaMoelans Oct 29, 2024
805dd04
added decref of temporary ringbuffer list
JoshuaMoelans Oct 29, 2024
3dc739a
removed double cloning
JoshuaMoelans Oct 29, 2024
0452b62
changing types from int32_t to size_t
JoshuaMoelans Oct 29, 2024
13fc770
moved declaration from public to private header
JoshuaMoelans Oct 29, 2024
2b56915
added decref
JoshuaMoelans Oct 29, 2024
751e8ff
type conversion
JoshuaMoelans Oct 29, 2024
190a4a5
applied suggestions from code review
JoshuaMoelans Oct 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/sentry_scope.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,10 @@ sentry__scope_apply_to_event(const sentry_scope_t *scope,
sentry_value_decref(contexts);

if (mode & SENTRY_SCOPE_BREADCRUMBS) {
PLACE_CLONED_VALUE("breadcrumbs",
sentry__value_ring_buffer_to_list(scope->breadcrumbs));
sentry_value_t l
= sentry__value_ring_buffer_to_list(scope->breadcrumbs);
PLACE_CLONED_VALUE("breadcrumbs", l);
sentry_value_decref(l);
JoshuaMoelans marked this conversation as resolved.
Show resolved Hide resolved
}

if (mode & SENTRY_SCOPE_MODULES) {
Expand Down
Loading