MasonProtter/Bumper.jl

@alloc detection too narrow

Opened this issue · 1 comments

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?

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.