Skip to content

Feature request: Add support for string length parameters #819

@brad-anderson

Description

@brad-anderson

Tools like std::string_view are becoming increasingly common in the C++ world, but that presents issues when interacting with interfaces that expect traditional null terminated strings because std::string_view isn't guaranteed to be null terminated.

The workaround is to allocate a temporary new null terminated string (on the stack, preferably) for the call to Sentry functions, but it would be nice if this could be avoided entirely so the sentry-native can be interacted without this additional cost.

I hit this stumbling block while creating a breadcrumb sink for spdlog which uses std::string_view for its log messages. There is no safe way of knowing which messages are null terminated, meaning you have to allocate a temporary string for every log message.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions