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

status_code_domain::string_ref and atomic_refcounted_string_ref have a bad API around zero termination #39

Open
ned14 opened this issue Dec 2, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@ned14
Copy link
Owner

ned14 commented Dec 2, 2021

  • The caller is expected to malloc a region length + 1 and zero terminate it before handing it in.
  • This is highly prone to mistake and surprise.
  • The API should be refactored around what path_view does i.e. caller must specify zero termination.
  • I also think caller should not be calling malloc in the first place, that's an internal implementation detail which should not be exposed.
  • Also what about on Freestanding where there is no malloc?
@ned14 ned14 added the bug Something isn't working label Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant