Skip to content

Add @check_allocs_call#46

Draft
jkrumbiegel wants to merge 1 commit into
JuliaLang:mainfrom
jkrumbiegel:jk/check_allocs_call_macro
Draft

Add @check_allocs_call#46
jkrumbiegel wants to merge 1 commit into
JuliaLang:mainfrom
jkrumbiegel:jk/check_allocs_call_macro

Conversation

@jkrumbiegel
Copy link
Copy Markdown

Draft implementation for #45

Not sure about keyword arguments, but they aren't mentioned in check_allocs either. And I haven't added any tests, yet.

Comment thread src/macro.jl
passed to `func` in the function call expression that `@check_allocs_call` is applied to.
For example, `@check_allocs_call 1 + 2.0` is equivalent to `check_allocs(+, (Int, Float64))`.
"""
macro check_allocs_call(ex...)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be a method/variant of @check_allocs. There is precedent for that with e.g. @timeit from TimerOutputs.jl: when applied to a function definition expression it enables timings for all calls, when applied to a call expression it times just that call.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, I wasn't aware this was being done elsewhere but seems relatively straightforward to explain, with no specific edge cases I could think of

@DilumAluthge
Copy link
Copy Markdown
Member

This PR hasn't had any activity for a while.

@jkrumbiegel Are you still interested in working on this PR?

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

Successfully merging this pull request may close these issues.

3 participants