Skip to content

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

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

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
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

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>
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