Skip to content

ref: add SENTRY_MAKE_0 macro for zero-initialized allocation#1546

Open
jpnurmi wants to merge 1 commit intomasterfrom
jpnurmi/ref/calloc
Open

ref: add SENTRY_MAKE_0 macro for zero-initialized allocation#1546
jpnurmi wants to merge 1 commit intomasterfrom
jpnurmi/ref/calloc

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented Mar 2, 2026

After getting bitten by an uninitialized struct member in #1545, I started wondering why not let calloc handle zero-initialization where appropriate. This adds a SENTRY_MAKE_0 macro that replaces the recurring SENTRY_MAKE + memset pattern. Less boilerplate, less room for error.

#skip-changelog

@jpnurmi jpnurmi force-pushed the jpnurmi/ref/calloc branch from 58ae155 to caffdc0 Compare April 10, 2026 14:20
@jpnurmi jpnurmi marked this pull request as ready for review April 10, 2026 15:41
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit caffdc0. Configure here.

Introduce sentry__calloc and SENTRY_MAKE_0 to replace the recurring
SENTRY_MAKE + memset(ptr, 0, sizeof(T)) pattern across the codebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jpnurmi jpnurmi force-pushed the jpnurmi/ref/calloc branch from caffdc0 to f02d495 Compare April 10, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant