MasonProtter / Bumper.jl

Bring Your Own Stack
MIT License
152 stars 6 forks source link

Fix `oom_error` function argument #18

Closed jipolanco closed 9 months ago

jipolanco commented 9 months ago

First of all, thanks for this really useful package!

I detected an issue in the latest (v0.3.0) version of Bumper.jl. The oom_error function is called with a single argument b::AllocBuffer in:

https://github.com/MasonProtter/Bumper.jl/blob/55d0ded058f7c3dd0bfac9c2802401bc2a4bc4bd/src/Bumper.jl#L68-L73

However, the only definition of oom_error takes no arguments:

https://github.com/MasonProtter/Bumper.jl/blob/55d0ded058f7c3dd0bfac9c2802401bc2a4bc4bd/src/Bumper.jl#L82-L85

Even in cases where the OOM error is never reached, this causes JET.jl to complain when analysing code which uses Bumper.jl.

This PR fixes the issue by including an unused positional argument to oom_error.

MasonProtter commented 9 months ago

Oh good catch, thank you!

I think I meant to make oom_error report how many bytes were allocated, but it's not really the most useful information so I think for now I'll leave it like this with the unused argument for now.