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

[Feature] Warning output instead of error #44

Open
muendlein opened this issue Nov 18, 2023 · 2 comments
Open

[Feature] Warning output instead of error #44

muendlein opened this issue Nov 18, 2023 · 2 comments

Comments

@muendlein
Copy link

In the current example allocations will trigger an error. However this may not always be desired, thus I propose a configuration option for a warning instead.

julia> using AllocCheck

julia> @check_allocs multiply(x,y) = x * y
multiply (generic function with 1 method)

julia> multiply(1.5, 2.5) # call automatically checked for allocations
3.75

julia> multiply(rand(3,3), rand(3,3)) # result matrix requires an allocation
ERROR: @check_alloc function encountered 1 errors (1 allocations / 0 dynamic dispatches)
@carstenbauer
Copy link
Member

Note that the advantage of errors is that you get a stack trace.

@aviatesk
Copy link
Sponsor Member

IIUC, it should be able to show stacktraces even if we don't raise an error. We can customize show(::IO, ::AllocCheckAnalysisResult) to include stacktrace into the rendered output.

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

3 participants