-
-
Notifications
You must be signed in to change notification settings - Fork 201
Description
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.