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

@alloc detection too narrow #23

Open
annuges opened this issue Nov 7, 2023 · 1 comment
Open

@alloc detection too narrow #23

annuges opened this issue Nov 7, 2023 · 1 comment

Comments

@annuges
Copy link

annuges commented Nov 7, 2023

In the switchover from 0.3 to 0.4 when replacing the function based alloc with the macro based version I always got the error that the @alloc is not within a @no_escape block even though it obviously was.

turns out the problem was my usage as Bumper.@alloc instead of just @alloc. From what I can see from a quick glance over the code the replacement code is looking explicitly for an @alloc. Perhaps this could bei widened?

@MasonProtter
Copy link
Owner

Ah interesting. So the trick here is that @alloc is not really its own macro. It's really just a special marker meant to be seen and handled by @no_escape. So I guess what I'd say is that you shouldn't really be typing Bumper.@alloc but only ever use @alloc directly..

I'll give some thought as to whether there's a clean way I can throw a better error here or something.

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

No branches or pull requests

2 participants